HOAs can function for Condo's, Co-Ops, Townhouses, and even SFR, (single family residence).
The important distinction is that the owners do not own the LAND under the redisences; and the HOA is responsible for the upkeep and maintenance of the land, including roads, walls/fences, gates, security, clubhouse/meeting rooms, etc.
The individal owners pay their share of the HOA's expenses.
This is the way it is supposed to work.
But, you will find that there are many variations,
If there are front yards, the HOA will pay gardeners to keep them, while the back yards are the owner's responsibility.
There will be a set of CCRs, (Covenants, Conditions and Restrictions), which you will pay for, (in more ways than one).
There are so many aspects of this, it cannot be adequately covered in a couple paragraphs; but the best advice would be to visit the Complex before you make an Offer, talk to residents, find out what it is like to live there.