This is a true account of the mercy of Allah be He Exalted and Glorified, to the believers. Fasting the month of Ramadan was prescribed in the early years after the hijra of the Prophet (SAWS) from Mecca to Medina. However, the rulings regarding fasting were not all revealed at once; there were several incremental updates from Allah sub’haanahu wa ta’ala that were sent down to the Prophet (SAWS) as revealed texts, and appearing in verses in the Quran.
For example, when the Prophet (SAWS) first came to Medina, they used to fast three days out of every month and they use to fast the day of Ashooraa. After that, Allah sub’haanahu wa ta’ala made it incumbent upon them to fast Ramadan, by revealing the verse: “O ye who believe! Fasting is prescribed to you as it was prescribed to those before you, that ye may (learn) self-restraint, (Fasting) for a fixed number of days; but if any of you is ill, or on a journey, the prescribed number (Should be made up) from days later. For those who can do it (With hardship), is a ransom, the feeding of one that is indigent. But he that will give more, of his own free will,- it is better for him. And it is better for you that ye fast, if ye only knew.” [2:183-184] observing the month of Ramadan became incumbent, but they had a choice; they could either fast, or they could ‘ransom’ their fast by feeding a poor person for every day instead of fasting. “For those who can do it, is a ransom, the feeding of one that is indigent.” [2:184] Still it was better for them to fast, by the verse; “But he that will give more, of his own free will,- it is better for him”. [2:184] Despite the choice of either fasting or feeding, fasting was deemed the better of the two options; “And it is better for you that ye fast, if ye only knew.” [2:184] In either case, it was better for them to do extra, such as feeding more than one person for each day or by fasting and feeding a person based upon the verse; “But he that will give more, of his own free will,- it is better for him”.
After that, another verse was revealed which made fasting incumbent (fard) upon everyone; “So every one of you who is present (at his home) during that month should spend it in fasting”, but if anyone is ill, or on a journey, the prescribed period (Should be made up) by days later. Allah intends every facility for you; He does not want to put to difficulties. (He wants you) to complete the prescribed period, and to glorify Him in that He has guided you; and perchance ye shall be grateful. [2:185] After this verse was revealed, it was incumbent on every person who was present when Ramadan came, to fast the month except for who was sick, or travelling. The dispensation of being able to ransom by feeding, instead of fasting, remained for the frail and the elderly, until this day. The companion of the Prophet (SAWS), Anas ibn Malik when he became a very old man, would have a big feast during Ramadan and feed thirty people at a time.
The companions of the Prophet (SAWS) used to, if a man was fasting, and the time of iftaar came but he fell asleep, or prayed ishaa before he ate a meal; he wouldn’t eat for the rest of the night and continue to fast until Maghrib the next day. So one day Qais ibn Sir’ma al-Ansaari was fasting and when the time of iftaar came, he said to his wife; do you have any food? She said: no but let me go and see if I can get some for you He had been working that day, so he ended up falling asleep (while he was waiting). She finally came and when she saw him asleep, she said: ‘you missed it’. It was reported in another narration that when his wife came to him with the food, he said to her: “I feel asleep”, she replied: “no you didn’t” and he insisted that he did. Nevertheless, he slept that night without eating anything, and the next day, when he got up in the morning, he was fasting. By the middle of the day, he lost consciousness. This incident was mentioned to the Prophet (SAWS) and then the verse was revealed: “Permitted to you, on the night of the fasts, is the approach to your wives. They are your garments and ye are their garments. Allah knoweth what ye used to do secretly among yourselves; but He turned to you and forgave you; so now associate with them, and seek what Allah Hath ordained for you,” [2:187], when this verse was revealed, the Muslims were extremely happy because as they understood it now, they were able to continue to eat, drink or have relationships with their wives throughout the night without restriction, whereas before, if they happened to fall asleep, or if they prayed ishaa, they wouldn’t eat afterwards until sunset the next day.
Right after that, the versed was revealed: “and eat and drink, until the white thread appear s to you distinct from the black thread; then complete your fast Till the night appears”. [2:187] However, the words; (of the dawn) were not revealed yet. So the companions of the Prophet (SAWS) updated their fasting according to what was revealed and would consider it permissible to continue to eat, drink, or have relations with their wives throughout the night until the dawn came, and many of them would tie a black and white thread around their leg.
It was reported about Sah’li ibn Sa’d, who said: the verse: “and eat and drink, until the white thread appears to you distinct from the black thread”, and the words; (from the dawn –min al-fajr) were not revealed. So when men wanted to fast, they would tie a black thread and a white thread around their leg, and continue eating in the morning, until they could distinguish one from the other. After that, Allah revealed the words: (of the dawn) and they knew then that what were meant were (the threads of night) and day. This is how Allah showed his mercy to the companions of the Prophet (SAW) and heralded in the fast of Ramadan as we know it today, step by step.