When a new campaign is created, settlements generate naturally with it. One of each ally homestead generates along with several villages. All settlements generate with a center with houses around it.
Piglins have a chance of attacking settlements (except the Well of Fate) at night, and if they succeed they will occupy the settlement. If a settlement is occupied by piglins, a certain amount of them will need to be defeated for the settlement to be freed. When villages are occupied, they can not be fast travelled to and they do not produce resources.