From the wisdom of fasting is that: It is an act of worship done for Allah, in which the 'abd (servant) draws closer to His Lord by abandoning the things that he loves and desires, such as food, drink and sexual intercourse. So because of this, the truthfulness of his Faith and the completeness of his servitude to Allah become apparent, as well as his love for Allah and his longing for what Allah has prepared for him (of good). This is since the one who fasts does not abandon something that is beloved to him except for that which is greater to him than it (which is Allah). When the believer knows that Allah's contentment lies in the fasting - which is abandoning those desires that he naturally loves - he will give his Lord's contentment precedence over his desires. So he abandons his desires no matter how much he longs and yearns for them, because his delight and the tranquillity of his soul lies in his abandoning all that for the sake of Allah.
And from the wisdom behind fasting is that it is a means of attaining taqwa (become God-fearing), as Allah says:
"O you who believe! Fasting is prescribed for you as it was prescribed for those who came before you; that you will perhaps be God-fearing." [Al-Qur'an 2:183]
This is since a person who is fasting is commanded to do the obligatory duties and to avoid sinful acts. The Prophet, peace be upon him, said:
"Whoever does not abandon false speech, acting upon that (false speech) and (acts of) ignorance (i.e. sins), then Allah has no need of him abandoning his food and drink." [Reported by Imam al-Bukhari]
So when a person is fasting, every time he desires to do a sinful act, he will remember that he is fasting and thus withhold himself from that. This is why the Prophet, peace be upon him, ordered the person who is fasting, when cursed at and abused, to say: "I am fasting", cautioning him that a person fasting is commanded to refrain from cursing and reviling, and reminding himself that he is fasting and cannot react with cursing.
And from the wisdom behind fasting is that the heart opens to contemplation and remembrance (of Allah). This is since fulfilling one's desires leads to heedlessness and perhaps the heart becomes hardened and blinded from the truth. This is why the Prophet, upon whom be peace, advised us to eat and drink little, where he said:
"The Son of Adam does not fill a vessel worse than his stomach." [Reported by Ahmad, an-Nisa'i and Ibn Majah]
And in Sahih Muslim, Handhala al-Usaydi, may Allah be pleased with him, who was one of the scribes of Allah's Messenger, said to the Prophet, peace be upon him:
"Handhala has become a hypocrite."
So Allah's Messenger said:
"Why is that?"
"O Messenger of Allah, when we are with you, you remind us of the Hellfire and Paradise, as if we see them with our own eyes. But when we depart from you, we meet our wives and our children and our homes and we forget much (of what we heard from you)."
In the last part of the hadith, the Prophet said to him:
"But O Handhala, there is a time for this and a time for that. There is a time for this and a time for that. There is a time for this and a time for that."
Abu Sulayman ad-Darani said:
"Indeed, when the soul hungers and thirsts, the heart softens and becomes pure. And when it is fed, the heart becomes blinded."
And from the wisdom behind fasting is that the person who has wealth is caused to realize the blessing of wealth that Allah has bestowed on him, such that Allah blessed him with food, drink and sexual intercourse. Many people are deprived of these things, so he should praise Allah for these blessings and thank Him for granting him them. And he should remember his brother who is poor and who probably goes through the day starved and hungry. So he should be generous to him and give him charity so that he can clothe his barrenness and satisfy his hunger.
And from the wisdom behind fasting is that it trains one to curb the soul, and it gives one strength to withhold his soul by its bridle, such that one can govern it and lead it towards that which is good for it and what will make it prosper. This is because the soul commands one to do evil, except for those souls that my Lord has mercy on. So when a person undoes and lets go of his (soul's) bridle, the soul lands him into many dangers. But when he controls it and curbs it, he is able to lead it to the highest of levels and the greatest of goals.
And from the wisdom of fasting is that the soul is broken down and restricted from having pride, to the point that it humbles itself to the truth and softens itself before the creation. This is because eating, drinking and having sexual intercourse with women - all of these things bring about insolence, arrogance, vanity and pride over people and over the truth. The soul preoccupies itself with trying to obtain these things because of its need for them. So when it obtains these things, the soul feels like it has conquered what it desired and so it falls into the happiness and pride that is condemned. And this is a cause for its destruction. Only those whom Allah protects are saved from this.
And from the wisdom behind fasting is that the passageways of blood (in the body) become narrow due to hunger and thirst, so therefore the passageways of the Devil in the human body also become narrower. This is since the Devil flows through the son of Adam like the flowing of blood, as is authentically recorded in the two authentic collections. So by fasting, the whisperings of the Devil are subdued and the strength of one's desires and anger are subjugated. This is why the Prophet, peace be upon him, said:
"O young men! Whoever amongst you can afford it, should get married, for it is the best means for lowering one's gaze and the best way of keeping (one's) private parts chaste. But whoever is not able to marry, then let him fast, for it has protection."
And from the wisdom behind fasting are the health benefits that come as a result of it, which are attained by in-taking little food, allowing the digestive system to rest for a specified time, which lets excess wastes and excrements that are harmful to the body be discharged.