While Purim is a holiday of light and gladness, joy and honor, it is also closely associated with fasting. After learning of Haman's plan, Esther sends word to Mordecai:
Then Esther bade them return answer unto Mordecai: 'Go, gather together all the Jews that are present in Shushan, and fast ye for me, and neither eat nor drink three days, night or day; I also and my maidens will fast in like manner; and so will I go in unto the king, which is not according to the law; and if I perish, I perish.'
So Mordecai went his way, and did according to all that Esther had commanded him.
Because of this it is traditional to fast before Purim. The point of fasting is to pray in preparation for, or in memory of, something. Thus people fast in Quadragesima (Lent) as a prayerful preparation for Holy Week, or, at least, that's what they should be doing; many, of course, just do it because that's what they've heard people do during Lent. Lent is fundamentally the fast in preparation for the joy of Easter. In the case of the fast of Esther, the fast was a prayerful preparation -- a physical cry to heaven -- in the face of a looming danger and clear need. As the Talmud says somewhere, when the community is in trouble, no one should go home with the thought of eating and drinking. People fast as an expression of their priorities; to purge themselves of weakness; to steal themselves for trouble ahead; and to cry out to God with their deeds. All of them are bound up in this sort of fasting.
Liturgically, we fast in preparation for the feast. As the twelfth canon of II Nicaea says,
It is very important to dedicate everything to God and not to become slaves of our own desires; for whether you eat or drink, the divine apostle says, do all for the glory of God.
Thus we are out not merely to eat and drink, but to do these things to divine glory; and fasting emphasizes this.
In any case, it seems fitting to end with an old rabbinical tradition about Purim:
On the day when Mordecai ordered his brethren to fast and humble themselves before God, he uttered the following supplication:
"Our God and God of our fathers, seated on Thy throne of grace! Oh Lord of the universe, Thou knowest that not through the promptings of a proud heart did I refuse to bow before Haman. Thee only I fear, and I am jealous of the glory of Thy presence; I could not give to flesh and blood Thy honour--to the creature that which belongs to the Creator alone. Oh God, deliver us from his hand, and let his feet become entangled in the net which he has spread for us. Let the world know, oh our Redeemer, that Thou hast not forgotten the promise which supports and strengthens us in our dispersion. 'And yet for all that, though they be in the land of their enemies, will I not cast them away, neither will I loath them to destroy them utterly, to break my covenant with them, for I am the Lord their God.'"
When Esther received the message of Mordecai, she too ordered a fast, and replaced her royal apparel with the sackcloth and ashes of mourning; and bowing her face before the Lord, she uttered this heartfelt prayer:
"God of Israel, from the beginning of time Thou hast reigned; the world and all it contains Thy power has created; to Thee, Thy handmaid calls for help! I am alone, oh God, without father and mother. Even as a poor woman, who begs from door to door, do I come before Thee for mercy, from window to window in the house of Ahasuerus. From Thee alone can help and salvation flow. Oh, Father of the fatherless! stand upon the right hand of the orphan, I beseech Thee; give her mercy and favour in the eyes of Ahasuerus, that he may be moved to grant her petition for the lives of her people. 'May the words of my mouth and the meditations of my heart be acceptable before Thee, oh Lord, my Rock and my Redeemer. Amen!'"