Religion is the means of realizing dharma, artha, kama and moksa. These four are called purusarthas.
In Tamil, dharma is called "aram"; artha is known as "porul'; and kama and moksa are called "inbam, " and vidu respectively. "Artha" occurs in the term "purusarthas", but it is itself one of the purusarthas? What a man wants for himself in his life- the aims of a man's life- are the purusarthas. What does a man want to have? He wants to live happily without lacking for anything. There are two types of happiness: the first is ephemeral; and the second is everlasting and not subject to diminution. Kama or in barn is ephemeral happiness and denotes worldly pleasure, worldly desires. Moksa or vidu is everlasting happiness, not transient pleasure. It is because people are ignorant about such happiness, how elevated and enduring it is, that they hanker after the trivial and momentary joys of kama.
Our true quest must be for the fourth artha, that is vidu or moksa. The majority of people today yearn for the third artha that is kama. When you eat you are happy. When you are appointed a judge of the high court you feel elated. You are delighted when presented with a welcome address by some institution, aren't you? Such types of happiness are not enduring. The means by which such happiness is earned is porul. Porul may be corn, money, and house. It is this porul that is the way to happiness. But the pleasure gained from material possessions is momentary and you keep constantly hungering for more.
Moksa is the state of supreme bliss and there is no quest beyond it. We keep going from place to place and suffer hardships of all kinds. Our destination is our home. A prisoner goes to his vidu or his home after he is released. But the word vidu also means release or liberation. Since we are now imprisoned in our body, we commit the grave mistake of believing that we are the body. The body is in fact our goal. Our real home is the bliss called moksa. We must find release from the goal that is our body and dwell in our true home. God has sentenced us to goal (that is he has imprisoned us in our body) for our sins. If we practice virtue he will condone our sins and release us from the prison of our body before the expiry of the sentence. We must desist from committing sinful acts so that our term of imprisonment is not extended and endeavor to free ourselves and arrive in our true home, our true home that is the Lord. This home is bliss that passeth understanding, bliss that is not bound by the limitations of time, space and matter.
Lastly, I speak of the first purusartha, dharma. Dharma denotes beneficent action, good or virtuous deeds. The word has come to mean giving, charity. "Give me dharmam. Do dharmam, mother, " cries the beggar. We speak of "dana-dharma" [as a portmanteau word]. The commandments relating to charity are called "ara-kattalai"in Tamil. Looked at in this way, giving away our artha or porul will be seen to be dharma. But how do we, in the first place, acquire the goods to be given away in charity? The charity practiced in our former birth- by giving away our artha- it is that brings us rewards in this birth. The very purpose of owning material goods is the practice of dharma. Just as material possessions are a means of pleasure, so is dharma a means of material possessions. It is not charity alone that yields rewards in the form of material goods; all dharma will bring their own material rewards.
If we practice dharma without expecting any reward in the belief that Isvara gives us what he wills- and in a spirit of dedication, the impurities tainting our being will be removed and we will obtain the bliss that is exalted. The pursuit of dharma that brings in its wake material rewards will itself become the means of attaining the Paramporul. Thus we see that dharma, while being an instrument for making material gain and through it of pleasure, becomes the means of liberation also if it is practiced unselfishly. Through it we acquire material goods and are helped to keep up the practice of dharma. This means that artha itself becomes a basis of dharma. It is kama or desire alone that neither fulfils itself nor becomes an instrument of fulfilling some other purpose. It is like the water poured on burning sands. Worse, it is an instrument that destroys everything dharmic thoughts, material possessions, liberation it-self.
All the same it is difficult, to start with, to be without any desire altogether. Religion serves to rein in desire little by little and take a man, step by step, from petty ephemeral pleasure to the ultimate bliss. First we are taught the meaning and implications of dharma and how to practice it, then we are instructed in the right manner in which material goods are to be acquired so as to practice this dharma; and, thirdly, we are taught the proper manner in which desires may be satisfied. It is a process of gaining maturity and wisdom to forsake petty pleasure for the ultimate bliss of moksa.
Moksa is release from all attachments. It is a state in which the Self remains ever in untrammeled freedom and blessedness. The chief purpose of religion is to teach us how this supreme state may be attained.
We know for certain that ordinary people do not achieve eternal happiness. The purpose of any religion is to lead them towards such happiness. Everlasting blessedness is obtained only by forsaking the quest for petty pleasures. The dictates of dharma help us to abandon the pursuit of sensual enjoyments and endeavor for eternal bliss. They are also essential to create a social order that has the same high purpose, the liberation of all. Religion, with its goal of liberation, lays down the tenets of dharma. That is why the great understand the word dharma itself to mean religion.
For a general background, please see here