Indonesia has a law that prohibits the sale of land to foreigners. And also according to the law, everything on the land belongs to the owner of that land. Therefore, when building properties, a lease or sublease of the land is executed for up to 20-30 years in the first iteration, and then for another 15-20 years. This is called leasehold - the most common type in Bali.
Importantly, when executing a leasehold, it is advisable to include terms in the contract stating your priority right to renew the lease at market value.
When making a purchase, the developer will usually sign 3 contracts with you:
1) for the construction of the object;
2) for the lease of the land under it;
3) for the management of the object by the management company.
If you want to sell your property, you will only need to re-register the land lease agreement to the new owner.
It is very rare for local people to sell their land to someone as a property (it is freehold). But even if they do, it can only be registered in the name of the company, plus the cost of the land will be significantly more expensive.