Ancient Indians believed that the Kingship arose out of military requirement. The Vedic literature has some speculations about the origin of kingship. A king must be a capable general whose leadership is recognized by all. A king can be successful in a battle if he possesses strength, energy and wisdom. When a person is selected to lead his side on account of these qualities and eventually wins, his position becomes stronger. Eventually he attains the status of the king and if he has talented sons, his office tends to become hereditary.
A Vajapeya sacrifice is performed at the coronation of a king where there is a symbolical chariot race in which the king comes out first. This element enables one to get a glimpse of that past when the military capacity of a leader was sought to be tested by the chariot race, before offering him the rank of a king.
The Vedic literature does not suggest that kingship was connected with the priestly office. The Vedic king discharges no religious functions nor does he preside over any sacrifices performed for the community as a whole. Nor is the king seen participating in public rituals after returning from a military campaign. During the early Vedic period the caste system was not that rigid so it is difficult to assert the caste of the Vedic king. However in the later Vedic period when the caste system was fully evolved, the king generally belonged to the Kshatriya caste. In the course of time Brahmins, Vaishyas and Shudras and non-Aryans established their own dynasties and the term rajan began to be applied even to non-Kshatriyas.
It is not known whether the kingship was elective in ancient India or not. It was elective in some cases in Vedic period. It is highly probable that the entire population did not vote on this occasion. In Vedic literature it has been mentioned that a passage in the later Vedic literature tells us that he alone becomes a ruler whose leadership is accepted by other kings. It is clear that its leaders like the kulapatis and the vispatis had a voice in the election of the king. The case of election was the exception rather than the rule. The usual tendency was to accept the leadership of the senior most member of the family and elect him as the king formally.
This formal election of the king was getting antiquated in the early Vedic period. The kingship is known to have passed from the father to the son for at least four generations among the Tritsus and the Purus. Monarchy had become hereditary long before the later Vedic period.