Itikaf (seclusion in the mosque during the last ten days of Ramadan) is for the completion of the benefits of fasting. If a person has remained denied of inner peace and tranquility and has been unable to concentrate on prayer and supplication during the earlier part of Ramadan, he can make amends for it through itikaf.
In Zad Al-Ma`ad, the prominent scholar Ibn Al-Qayyim says—
The basic purpose of itikaf is that the heart gets attached to Allah, and, with it, one attains inner composure and equanimity; preoccupation with the mundane things of life ceases, and the state is reached in which all fears, hopes, and apprehensions are superseded by the love and remembrance of Allah; every anxiety is transformed into the anxiety for Him; every thought and feeling is blended with the eagerness to gain His nearness and to earn His good favor, and devotion to the Almighty is generated instead of devotion to the world. This is the provision for the grave where there will be neither a friend nor a helper. This is the high aim and purpose of itikaf, which is the specialty of the most sublime part of Ramadan, that is, the last ten days.
Similarly, Shah Waliullah remarks in his Hujjatullahi Al-Balighah—
Since i`tikaf in the mosque is a means to the attainment of peace of mind and purification of the heart, and it affords an excellent opportunity for forging an identity with the angels and having a share in the blissfulness of Laylat Al-Qadr (the Night of Decree), and for devoting oneself to prayer and meditation, Allah has set apart the last ten days of the month of Ramadan for it and made it a sunnah for His pious and virtuous slaves.
The Prophet (peace and blessings be upon him) always observed itikaf and the Muslims have, on the whole, adhered to it. All the schools of jurisprudence are agreed that itikaf is not obligatory but a sunnah (recommended act). According to the Hanafi school, it is a sunnah mu’akkadah (according to the Hanfis, sunnah mu’akkadah is a religious practice which, though not obligatory, was observed regularly by the Prophet and one is liable to be questioned for neglecting it without a valid reason) and sunnah kifayah (meaning such religious practices which, if they are observed by a few persons, are considered to have been observed by all). It has become a regular feature of the month of Ramadan and a confirmed practice with the devout and the faithful. A’ishah (may Allah be pleased with her) relates that the Prophet (peace and blessings be upon him) regularly observed itikaf during the last ten days of Ramadan till the end of his life. After him, his wives followed (Al-Bukhari and Muslim).
It is related by Abu Hurairah (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) observed i`tikaf for ten days every year in the month of Ramadan. In the year of his death he did it for twenty days (Al-Bukhari).
By Sheikh Abu Al-Hasan `Ali Nadvi*