Shylock acted pre-emptively to get Antonio arrested.
In Act III, Scene I, Tubal brings assorted news to Shylock, of Antonio's bad luck with his ships and of Jessica spending her father's wealth. From the following quote (emphasis mine), it seems that at this point Antonio is not yet in a state of bankruptcy, but it's certain that he will reach that point and be unable to pay back the money owed to Shylock:
TUBAL: There came divers of Antonio's creditors in my company to Venice, that swear he cannot choose but break.
Shylock's immediate response is to try to get hold of an "officer" (presumably an official of the state of Venice, who could have Antonio arrested or imprisoned as a debtor as soon as necessary). Shylock wishes to "fee" (pay for) and "bespeak" (reserve) his services even two weeks in advance. It seems he doesn't trust Antonio not to flee Venice instead of staying to face his situation and pay his debts:
SHYLOCK: Nay, that's true, that's very true. Go, Tubal, fee me an officer; bespeak him a fortnight before. I will have the heart of him, if he forfeit; for, were he out of Venice, I can make what merchandise I will. Go, go, Tubal, and meet me at our synagogue; go, good Tubal; at our synagogue, Tubal.
The next time we see Antonio (in Act III, Scene III), he's in the custody of a Gaoler, who has allowed him out of prison to walk the streets briefly, and Shylock is insisting that he must receive his bond and telling the Gaoler he is too soft on Antonio:
SHYLOCK: Gaoler, look to him: tell not me of mercy;
This is the fool that lent out money gratis:
Gaoler, look to him.
[...] I do wonder,
Thou naughty gaoler, that thou art so fond
To come abroad with him at his request.
It seems that Shylock made sure Antonio was arrested and held in custody as soon as it was legally possible to do so, not trusting him to pay the bond he owed no matter how much willingness he professed. (Actually, it seems his resignation to his fate came later - in this scene he is still trying to ask Shylock for mercy - but we never see any indication that, as Shylock implied, he would have fled Venice to escape the law and the paying of this bond.)
Others, even the duke, were fighting on Antonio's behalf.
Even if Antonio himself became resigned to his fate, never fighting the terms on his own behalf even in the courtroom, others were willing to take up the legal and moral battle on his behalf: both people who cared about him, such as Bassanio and Portia, and people who simply disliked the brutality of Shylock's bond, up to and including the duke of Venice himself.
In Act III, Scene II, the reactions of the duke and other officials are described at second or third hand by Salerio, as we see in the following lines (emphasis mine):
SALERIO: Besides, it should appear, that if he had
The present money to discharge the Jew,
He would not take it. Never did I know
A creature, that did bear the shape of man,
So keen and greedy to confound a man:
He plies the duke at morning and at night,
And doth impeach the freedom of the state,
If they deny him justice: twenty merchants,
The duke himself, and the magnificoes
Of greatest port, have all persuaded with him;
But none can drive him from the envious plea
Of forfeiture, of justice and his bond.
The courtroom is not a criminal one with a jury of citizens; it is a civil trial, presided over by the duke of Venice, who it seems has the right to throw out the case or to make a final decision. His human side, not wishing to see Antonio bloodily killed, is tempered by his knowledge that failing to give Shylock his due will be bad PR for his state. As Antonio says in Act III, Scene II:
SALARINO: I am sure the duke
Will never grant this forfeiture to hold.
ANTONIO: The duke cannot deny the course of law:
For the commodity that strangers have
With us in Venice, if it be denied,
Will much impeach the justice of his state;
Since that the trade and profit of the city
Consisteth of all nations.
Perhaps it was he, as head of state, who allowed the case to come to an open court. Shylock was demanding his bond despite many others (even after Antonio himself gave up) pleading with him not to insist upon it. Probably the duke could have allowed this to go ahead as a private transaction between two individuals, without a public court case; but, since he himself was one of the people asking Shylock not to insist on receiving his pound of flesh, perhaps he felt that this was the best way to shame Shylock into backing down. The evidence for this is in the duke's first words to Shylock after opening the court in Act IV, Scene I:
DUKE: Shylock, the world thinks, and I think so too,
That thou but lead'st this fashion of thy malice
To the last hour of act; and then 'tis thought
Thou'lt show thy mercy and remorse more strange
Than is thy strange apparent cruelty;
And where thou now exact'st the penalty,
Which is a pound of this poor merchant's flesh,
Thou wilt not only loose the forfeiture,
But, touch'd with human gentleness and love,
Forgive a moiety of the principal;
Glancing an eye of pity on his losses,
That have of late so huddled on his back,
Enow to press a royal merchant down
And pluck commiseration of his state
From brassy bosoms and rough hearts of flint,
From stubborn Turks and Tartars, never train'd
To offices of tender courtesy.
We all expect a gentle answer, Jew.
And, later in the same scene, he makes clear that he has the power to dismiss the court if the case cannot be decided clearly:
DUKE: Upon my power I may dismiss this court,
Unless Bellario, a learned doctor,
Whom I have sent for to determine this,
Come here to-day.
He couldn't simply dismiss Shylock's claim out of hand, because of the PR reasons mentioned above, but he could certainly do his best to tip the scales (pun unintended) in favour of Antonio, trying to shame Shylock into backing down and rescinding his claim. This would explain why he, as the head of state, convened the whole court instead of simply allowing the pound of flesh to be taken since Antonio had given up objecting.