Hamma may be imprisoned, but she's learning a lot. Gen, season 3 spoilers.
The cage gave Hamma a lot of time to think. She hadn't thought much about the world, and her place in it, before they'd locked her away--first, she had been a child, concerned only with childish things, and then the war had come and there had been no time to stop for anything. Now, however, there wasn't much else to do but think and watch.
She watched the rats that swarmed around the cages, eating any crumbs they could find. The bigger rats were able to bully the smaller ones and take more food for themselves; this was not surprising. As she learned to distinguish one rat from another, however, she learned more. She could see how most of the smaller rats were pushed to the fringes of the group, but one or two, the ones who were especially clever or fierce, were able to get enough food and grow big themselves.
Hamma watched the guards as well, and slowly she began to see many things that reminded her of the rats. There were two kinds of soldiers, she found: those who had guarded the prisoners for years, and would continue to do so for years to come, and those who patrolled for only a short time before graduating to some higher position. (There was also a third kind, the incompetent who quickly disappeared, but these were rare. The Fire Nation was apparently very careful in choosing those allowed contact with the prisoners.) Unlike the rats, physical size didn't seem to play much of a role in who stayed and who left. But those who didn't remain lowly prison guards, those who were promoted--there was a difference in them. As with the rats, they were more clever, or more ruthless, or both. These were the qualities that led to hushed conversations between the guards about how some former colleague had risen to become a general, or an admiral, or some other lofty position.
Finally, Hamma watched the other prisoners. They were the dullest group, by far. Many of them were obviously, like her, trying to figure out a way to escape. Others were still trying to convince the guards to let them go. And some had given up hope entirely, and only lived because there was no way for them to commit suicide. No matter what their outlook, though, their situation was the same--defeated and imprisoned.
Hamma watched all of them, people and animals alike, and considered her own situation carefully in light of what she saw. Her fellow prisoners were no help; if any of them had the ability to escape, they would have done so long ago. But the rats and the guards held a key. There were really only two sorts of people, Hamma decided: the powerful and the powerless. And the only way to gain power was through strength: brute physical force, or bending, or intelligence, or an iron will.
Hamma's strength was Waterbending, but it had been taken away from her. She would have to rely on her wits to find a way out of this situation. Ruthlessness would not be a problem; any compassion in her had been burned out by the Fire Nation long ago, and she was willing to do absolutely anything to get revenge. But what could she do, with no water around? They were isolated from rain or groundwater. The prison was kept cool, so they would not sweat, and the air was dry. The precautions around drinking water were so elaborate that there was no hope in breaking them. The only water they had was in their own bodies.
So how could that water be used? Hamma pondered this question for many weeks, and finally one day it all came together. She looked at the veins in her forearms. Watched one of the rats (one who'd fought his way to the top, the one she'd nicknamed San after her brother) scurry across the floor. And slowly, she smiled.
It took her eight agonizing years and far too many dead ends. Her first experiments, trying to pull water directly from the rats' blood, ended messily, and the guards, always suspicious, had kept a special eye on her for several months afterward. Then after they stopped, it was several more months before she could tempt the rats back to her cage. This time she tried control; it only worked during the full moon, and then only barely, but it was a ray of hope. She learned and relearned patience a million times. Slowly, painstakingly, she refined her technique. And finally, her hard work paid off, and the door of her cage swung open.
"What's going on?"
"Is that Hamma?"
"How did she do it?"
"Hamma! Let us out too!"
The whispers were becoming increasingly frantic, but Hamma ignored them as she turned toward the exit. She knew the truth now: all that mattered was power, and who held it. Knowing this, she felt no pity for those who had been her fellow prisoners. They were just rats who were too small and stupid and weak to get food.
"If you can't get out yourselves, then you don't deserve freedom," she told them, and laughed in the shocked silence that followed. It was a sound she hadn't made in a long time.
The prisoners started talking again, begging her, offering whatever they could think of, but Hamma paid no further attention to their pleas. Step by quivering step, she walked into freedom, and left them all behind.