It is never explained.
The best we get is the guard proclaiming “He was like a one-man army!” and a visual of snapped and bent cell bars.
Iroh presents himself with a very unassuming manner that makes it easy to forget that he is one of the most martially powerful and intelligent people alive.
I suspect that he began manipulating the integrity of the bars with fire long before the eclipse. Low-level heating makes them malleable to the point that they will bend and break just like you see in the episode. (Imagine if the bars were built out of metal the tensile strength of cheap metal tableware.)
When the time came, he burst the bars by either fire bending them immediately before the eclipse took effect or by sheer brute strength. Either way, the guards would have been unprepared for this, even if they were present in his cell at the time. Dealing with the unprepared and under-trained guards after that was only made more difficult by doing it without killing them.
I personally suspect this is one of the reasons he chose the time of the Black Sun to do it as well. By removing fire bending, he removed the single most deadly variable from the equation.
That, and fire benders are typically not very good martial artists when they can’t fire bend. It is even given several times in the series that fire benders rely too much on the fire itself. In that same episode, recall that palace soldiers went from “We’ll never give up!” to complete submission once they realized they couldn’t bend, and even the army took steps to retreat and save fighting for only when they had bending.
Of course, my personal opinion presumes some semblance to reality in the details. The other possibility is the obvious super-human nature of a television program about super-human people, where Iroh DBZed it up and bust through those rails with his immense, super-human strength.