( O ye who believe! Fasting is prescribed to you as it was prescribed to those before you, that ye may (learn) self-restraint.)
Islam teaches that the purpose of fasting is not to make people hungry and thirsty, or to deprive them some of their comfort and conveniences. The real purpose of fasting, according to Islam, is to learn piety.
Piety is highly emphasized in the Quran and Sunnah. There are more than 158 verses in the Quran on piety, and there are hundreds of hadiths on this subject. Muslim scholars see piety as being Islam itself. It is the total sum of all Islamic values and virtues. If one has piety, one has achieved everything. Piety is the consciousness of God. It is to do one’s best efforts to live by His commands and to avoid His prohibitions. The Quran has used the word piety to mean consciousness of God, fear of God, worship of God, sincerity in faith, and avoidance of disobedience to God.
How does fasting build the character of piety according to the Islamic worldview? Let us look at some of the things that a fasting person is supposed to do, and see how they are related to the concept and spirit of piety.
Unlike Prayers, charity, and pilgrimage, fasting is an invisible act. According to Islam, only God and the person who is fasting know whether he or she is fasting or not. One may quietly eat or drink something and no one will notice and no one can find out. However, the fasting person has made this commitment for the sake of God and he or she wants to guard the purity of his or her fast for the sake of God. Fasting thus teaches sincerity, and it helps a person learn to live by the principles of his or her faith regardless whether others know or do not know. This is the very purpose and essence of piety.
Food and sexual intercourse are two needs and desires that are essential for human survival and growth, but they can become easily corruptive and disruptive if they are not properly controlled and disciplined. Piety requires observing the rules of God when one eats and when one enjoys sexual relations. Fasting teaches how to control and discipline these desires.
The world is full of temptations. It takes a lot of discipline to say "no" to something that is very tempting but not good for us. During fasting we learn how to say "no" to things that are otherwise permissible and good, but are forbidden during fasting. When one learns how to say "no" to that which is generally permissible, then one can easily control oneself to avoid that which is forbidden. This is the spirit of piety.
People generally care for themselves and their families, but they often ignore the needs of others. Those who are wealthy do not feel the pain and suffering of those who are hungry, homeless, and living in poverty. Through fasting we taste — to some extent — the pain and suffering of those who are poor and destitute. Fasting teaches empathy and sympathy, and it takes away some of our selfishness and self-centeredness. This is the spirit of piety.
When Muslims fast together in the month of Ramadan, it builds an atmosphere of virtues, brotherhood and sisterhood. They come closer to their Creator and also come closer to each other. Unity, peace, harmony, brotherhood and sisterhood are the fruits of piety. In Ramadan, Muslims enjoy these fruits as they learn to grow in piety.