After obtaining territories, rulers appointed soldiers to protect them. They then needed farmers to grow enough feed for the soldiers in question. Before they knew it, a thriving town with merchants, craftsmen, trade, and all the necessary infrastructure to support them was born.