The easiest way to get your own settlement is to join one of the established kingdoms as a mercenary. Work for a faction and get a settlement as a reward
Towns are a little better than castles, in that you'll have more actions you can take while inside them, while castles are easier to defend during sieges.
The surrounding villages contribute to your town or castle's overall wealth and prosperity, but are also vulnerable to being raided for supplies by enemy nobles or bandits. These are towns and castles which you can take over control of. This Mount And Blade 2 Bannerlord settlement guide will teach you the basics of how to take over and manage your own town, as well as how to defend it against invaders.
Taking over the settlements is rather difficult, but keeping control and developing them further is also a big challenge. This means managing the many settlements that you'll be conquering along the way. You're also be able to take on the role of ruler in your own kingdom. It's not all just battles in Mount And Blade 2 Bannerlord.