Monarchs protected townspeople in case someone would attack them or they would ensure that townspeople had their rights or solve their disputes judicially. In return, townspeople would pay taxes to the monarch, give him goods, or go to war for him if need be.
Step-by-step explanation:
The townspeople inflicted peace and unity, better business conditions, and their own court systems. And the monarchs extended their stay between nobles and support in towns and were able to save money by reducing the size of their armies.