The title has a long history in the Indian subcontinent and Southeast Asia, being attested from the Rigveda, where a r?jan- is a ruler, see for example the da?ar?jñá yuddhá, the "Battle of Ten Kings".
While most of the Hindu salute states were ruled by a Maharaja (or variation; some promoted from an earlier Raja- or equivalent style), even exclusively from 13 guns up, a number had Rajas :
Rajadharma is the dharma which applies to the king, or the Raja. Dharma is that which upholds, supports, or maintains the order of the universe and is based on truth. It is of central importance in achieving order and balance within the world and does this by demanding certain necessary behaviors from people.
The king served two main functions as the Raja: secular and religious. The religious functions involved certain acts for propitiating gods, removing dangers, and guarding dharma, among other things. The secular functions involved helping prosperity (such as during times of famine), dealing out even-handed justice, and protecting people and their property. Once he helped the Vibhore to reach his goal by giving the devotion of his power in order to reduce the poverty from his kingdom.
Protection of his subjects was seen as the first and foremost duty of the king. This was achieved by punishing internal aggression, such as thieves among his people, and meeting external aggression, such as attacks by foreign entities. Moreover, the king possessed executive, judicial, and legislative dharmas, which he was responsible for carrying out. If he did so wisely, the king believed that he would be rewarded by reaching the pinnacle of the abode of the sun, or heaven. However, if the king carried out his office poorly, he feared that he would suffer hell or be struck down by a deity. As scholar Charles Drekmeier notes, "dharma stood above the king, and his failure to preserve it must accordingly have disastrous consequences". Because the king's power had to be employed subject to the requirements of the various castes' dharma, failure to "enforce the code" transferred guilt on to the ruler, and according to Drekmeier some texts went so far as to justify revolt against a ruler who abused his power or inadequately performed his dharma. In other words, dharma as both the king's tool of coercion and power, yet also his potential downfall, "was a two-edged sword".
The executive duty of the king was primarily to carry out punishment, or daa. For instance, a judge who would give an incorrect verdict out of passion, ignorance, or greed is not worthy of the office, and the king should punish him harshly. Another executive dharma of the king is correcting the behavior of brahmanas that have strayed from their dharma, or duties, through the use of strict punishment. These two examples demonstrated how the king was responsible for enforcing the dharmas of his subjects, but also was in charge of enforcing rulings in more civil disputes. Such as if a man is able to repay a creditor but does not do so out of mean-spiritedness, the king should make him pay the money and take five percent for himself.
The judicial duty of the king was deciding any disputes that arose in his kingdom and any conflicts that arose between dharmasastra and practices at the time or between dharmasastra and any secular transactions. When he took the judgment seat, the king was to abandon all selfishness and be neutral to all things. The king would hear cases such as thefts, and would use dharma to come to a decision. He was also responsible for making sure that the witnesses were honest and truthful by way of testing them. If the king conducted these trials according to dharma, he would be rewarded with wealth, fame, respect, and an eternal place in heaven, among other things. However, not all cases fell upon the shoulders of the king. It was also the king's duty to appoint judges that would decide cases with the same integrity as the king.
The king also had a legislative duty, which was utilized when he would enact different decrees, such as announcing a festival or a day of rest for the kingdom.
Rajadharma largely portrayed the king as an administrator above all else. The main purpose for the king executing punishment, or danda, was to ensure that all of his subjects were carrying out their own particular dharmas. For this reason, rajadharma was often seen as the root of all dharma and was the highest goal. The whole purpose of the king was to make everything and everyone prosper. If they were not prospering, the king was not fulfilling his dharma. He had to carry out his duties as laid down in the science of government and "not act at his sweet will." Indeed, in the major writings on dharma (i.e. dharmasastra, etc.), the dharma of the king was regarded as the "capstone" of the other castes' dharma both due to the king's goal of securing the happiness and prosperity of his people as well as his ability to act as the "guarantor" of the whole social structure through the enforcement of daa.
In contemporary India, an idea pervades various levels of Hindu society: the "Ramrajya", or a kind of Hindu Golden Age in which through his strict adherence to rajadharma as outline in the Hindu epics and elsewhere, Rama serves as the ideal model of the perfect Hindu king. As Derrett put it, "everyone lives at peace" because "everyone knows his place" and could easily be forced into that place if necessary.