HOAs are usually a thing set up by the builders to make their lives easier for some paperwork and stuff.
Builders are encouraged by the local government to set up HOAs because it lets said government shirk its responsibility to maintain infrastructure and services.
If your subdivision is gated, its streets are private and the homeowners are responsible for repaving them, for instance.
(Of course, that's only a motivation cities caught onto relatively recently. The original reason for HOAs -- at least for neighborhoods of single-family houses, as opposed to condos that have legitimate shared maintenance -- was to help keep black people out.)