As I understand it, they get the titles automatically by birthright. Even in this day people seem to worship or otherwise be fascinated by kings, queens, princes, princesses, etc.
The thought crossed my mind again after I ran across a TIL today "The Dutch royal family took refuge in Canada during WW2 occupation, upon the birth of Princess Margriet, the Ottawa maternity ward was temporarily declared to be Dutch territory by the Canadian government. Since then every year the Dutch people send Canada thousands of tulips in appreciation.". Like, why would a country bother to grant territory like this, and why some other people would carry out a tradition for generations in gratitude for helping out a family that happened to be simply born into their good fortune?
Not sure this sub is the best home for this question; while you may get answers here, it may be worth trying in /r/AskSocialScience or /r/Psychology