Answer
Wa `alaykum as-salam wa rahmatullahi wa barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
Waqf signifies an important value that contributes to the well-being and stability of Muslim communities. It relates to vital aspects that greatly affect the interests of society, such as the social, financial, educational, and medical fields.
In his response to your question, Sheikh Ahmad Kutty, a senior lecturer and Muslim scholar at the Islamic Institute of Toronto, Canada, stated,
Waqf is an important institution in Islam — one of the best ways of leaving a legacy of good deeds that are abiding and enduring. Unlike other investments whose benefits one may derive in this worldly life, waqf is an investment with Allah, and its benefits will continue to be reaped long after one dies.
The word waqf in Arabic means to hold, to set aside, or to dedicate; later, the word came to mean setting up perpetual charities or endowments for the benefit of the poor or the general public, or even for the benefit of one’s own family after one’s death.
Abu Hurairah narrated that Prophet Muhammad (peace and blessings be upon him) said, “When a person dies, all of his deeds cease, except three: an ongoing charity he gave, beneficial knowledge he imparted, or a righteous offspring who prays for him.” (Muslim)
The Prophet (peace and blessings be upon him) endowed the property he had in his possession as a charity for the poor after his death. When Allah revealed the verse “You can never attain to true piety unless you spend on others out of what you cherish yourselves, and whatever you spend, verily Allah has full knowledge thereof” (Aal `Imran 3:92), Abu Talhah (one of the Prophet’s Companions) told the Prophet that since the best piece of property he had was the Bayruha orchard, he would like to give it away in charity. Then the Prophet told him, “It would be better for you to endow it to the poor relatives as a source of living.” Accordingly, Abu Talhah did just that. (Al-Bukhari)
Also, thanks to Prophetic exhortations, `Uthman ibn `Affan (may Allah be pleased with him) purchased the well of Rumah and endowed its water for public use. Likewise, when `Umar ibn Al-Khattab (may Allah be pleased with him) asked the Prophet what he should do with the property he had acquired in Khaybar, the Prophet advised him to endow it as a waqf. After the Prophet’s death, a number of his Companions, including his own wives, also followed these precedents and set up waqf investments as perpetual charities.
Inspired by such precedents, the Muslims developed the system of waqf, which consists of perpetual charities or endowments.
The system of waqf gradually evolved to become one of the greatest institutions in Islam. Thanks to such a system, mosques, universities, educational institutions, hospitals, caravansaries, dispensaries, Sufi lodges, etc. flourished throughout the Muslim World. Rich people have vied with one another in endowing funds for all kinds of public services, including planting fruit and shade trees, providing water facilities for the cities, entertaining those who are hospitalized, and even setting up animal shelters for dogs, cats, etc.
May Allah inspire us all to leave legacies of good deeds that are abiding and enduring; amen.
Allah Almighty knows best.