This question is related to "Harry Potter - How can Dementors be trusted to guard Azkaban?" but the answers there don't cover it.
What, exactly, did the Dementors do while in Azkaban? We're told that they guard it — but how?
I assume that the prisoners were behind bars, and the Dementors basically just hung around waiting to see if someone managed to escape their bars, in which case they would feed on their souls.
This poses a few problems. If the bars (or other magical protections or whatever) held, the Dementors would effectively be starved, because there'd be no one to feed on. We also assume that they can't (or won't) pass through the bars. If it's a magical protection, this makes sense, but on the other hand, people must get in there somehow. At some point a wizard guarding Azkaban must bring in a new prisoner, and the Dementors would "agree" not to suck that person's soul.
According to The Harry Potter Wikia on Dementors:
They are also intelligent enough to be greedy: they obeyed the Ministry of Magic for years because, in guarding Azkaban, they were provided with sustenance of any remaining hope or happiness in the prisoners.
So, it would seem that they just sort of float around, surviving on the remaining hope or happiness of new prisoners (since we'd have to assume you'd run out of hope pretty quickly with a Dementor eating it). In addition, I'd think the greedy thing to do would be to suck the soul out of the prisoner as they're getting to their cell.
What, exactly, did the Dementors do in Azkaban? How did they guard it?