ALLAH swt describes the purpose of fasting in one verse in holy Quran,
“Oh you who believe! Fasting is prescribed for you just as it was prescribed for those before you. Perhaps you would attain piety!”
The last words of the verse mean that the purpose of fasting is to obtain piety. The one who fasts, he purifies his inner self by bearing the thirst and hunger to seek ALLAH ‘s peasure. But if the purpose of fasting is to show off or to complete and obligation, then, this fasting will not be an act of spirit but a spiritless act.
So, fasting means to be mor eobidient to ALLAH swt. The blessed night of qadar also comes in the month of Ramadan when shaitan is a captive and the will of man is not affected by his biggest enemy but it is his own conscience that can mislead him or that can take him to the right path. The blessed night of 27th Ramadan is the night when Quran was completed on Prophet Muhammad s.a.w.w. so the real purpose of fasting in Ramadan has been joined with many blessings and great times.
A hadith of Holy Prophet Muhammad s.a.w.w describes the fast beautifully.
bukhariVolume 9, Book 93, Number 584:
Narrated Abu Huraira: The Prophet said, "Allah said: The Fast is for Me and I will give the reward for it, as he (the one who observes the fast) leaves his sexual desire, food and drink for My Sake. Fasting is a screen (from Hell) and there are two pleasures for a fasting person, one at the time of breaking his fast, and the other at the time when he will meet his Lord. And the smell of the mouth of a fasting person is better in Allah's Sight than the smell of musk." (See Hadith No. 128, Vol. 3).
To break the fast being a true servant of ALLAH all day when man is hungry and thirsty, he shows his love, his sincerity towards islam and his humbleness and his actions are only to seek ALLAH’s pleasure, for such a man the hell fire will not b a trouble, if he continues doing good deeds.
So the real purpose of fasting lies within the hunger and thirst which can be for ALLAH swt or for simply completion of an obligation or show off. If one chooses to observe fast to learn, he will learn, if one chooses to be an ignorant he will remain ignorant.
In another hadith, the purpose of fasting has been highlighted beautifully.
Bukhari Volume 8, Book 73, Number 83:
Narrated Abu Huraira: The Prophet said, "Whoever does not give up false statements (i.e. telling lies), and evil deeds, and speaking bad words to others, Allah is not in need of his (fasting) leaving his food and drink."
A hadith of Prophet Muhammad s.a.w.w says “actions are judged by intentions”. If ones intention is not to be humble, he will never be able to achieve the real purpose of living leave aside fasting, if someone intentions are good, this will make him God fearing and his every action will be a step further in ALLAH’s way.