In the later Vedic Age (600 BC to 300 BC), a number of small kingdoms or city states had covered the subcontinent. These are mentioned in Vedic, early Buddhist and Jaina literature.
Sixteen monarchies and republics are known as the Mahajanapadas:
Mahajanapadas stretched across the Indo-Gangetic Plain from modern-day Afghanistan to Bengal and Maharastra. This period saw the second major rise of urbanism in India after the Indus Valley Civilisation.
Many of the sixteen kingdoms had coalesced to four major ones by the time of Gautama Buddha. These four were Vatsa, Avanti, Kosala, and Magadha.
A horse was let loose to wander freely and it was guarded by the raja’s men. If the horse wandered into the kingdoms of other rajas and they stopped it, they had to fight. If they allowed the horse to pass, it meant that they accepted that the raja who wanted to perform the sacrifice was stronger than them.
These rajas were then invited to the sacrifice, which was performed by specially trained priests, who were rewarded with gifts. The raja who organised the sacrifice was recognized as being very powerful, and all those who came brought gifts for him.
The rajas who performed big sacrifices were recognized as being rajas of janapadas. About 2500 years ago, some janapadas became more important than others, and were known as mahajanapadas. Most mahajanapadas had a capital city, many of these were fortified.
Forts were built because people were afraid of attacks from other kings and needed protection. It is also likely that some rulers wanted to show how rich and powerful they were by building really large, tall and impressive walls around their cities. The new rajas now began maintaining armies. Soldiers were paid regular salaries and maintained by the king throughout the year.
As the rulers of the mahajanapadas were building huge forts and maintaining big armies, they needed more resources. They also needed officials to collect these. So, instead of depending on occasional gifts brought by people, as in the case of the raja of the janapadas, they started collecting regular taxes.