How did Gilead survive for so long?

Gilead in the shows and the book seems to last for at least 20+ years. I don't really understand how it lasted so long considering 99% f the population were miserable with scarce food, terrible education, no opportunities, no freedom and no rights. It only really benefitted the top 0.1% who were commanders and maybe some commanders wives like Serena.

For literally everyone else it sucked so I'm just surprised it lasted that long tbh.