The HOA bill keeps increasing until it could be tens of thousands of dollars. When the landlord eventually sells the property the HOA is then able to get payment from the new buyer before the former owner receives the funds.
Since legal action is so expensive, this is almost always how the HOA eventually gets their money. Of course if the bill goes over 30k, then it might be worth their time to go through litigation to get their money.
However, it's possible to have an HOA that just doesn't give a shit and does no enforcing.
It's already illegal to not do certain maintenance on your house (blight, etc.) especially if you have tenants living there. (tenant protection laws)
So enforcement is the key.
Almost every new/private development (as opposed to houses built along public roads or something) has one. That's how the resources to build up the common area are marshaled.
I think of the definition of "gated community" as a little squishy so I wasn't sure of absolutes. Now that I think about it more though, the "gate" part pretty much necessitates private roads as public roads would be open to the public. Kinda feel silly, "public" is in the name.