Shaykh Muhammad bin Saalih al-Uthaymeen rahimahullaah said in his explanation of ‘Bulooghul-Maraam‘ ‘Fathu Dhil-Jalaali wal-Ikraam‘ vol. 7 pge. 9:

And know that the obligation of fasting was in three stages.

So first fasting the day of `Aashooraa (the 10th day of the first month in the Islamic calendar, Muharram) was made obligatory, then fasting the month of Ramadaan was prescribed for those who wished to fast it, then fasting the month of Ramadaan was made obligatory specifically [upon everybody; individually] – meaning: fasting it is a must.

(1) As for the first stage: then the proof for it is the Prophet sallAllaahu `alaihi wa sallam commanding his Companions to fast `Aashooraa.[1]

(2) And as for the second stage: then the proof for it is the saying of Allaah – the Exalted and Most High –:

وَعَلَى الَّذِينَ يُطِيقُونَهُ فِدْيَةٌ طَعَامُ مِسْكِينٍ ۖ فَمَن تَطَوَّعَ خَيْرًا فَهُوَ خَيْرٌ لَّهُ ۚ وَأَن تَصُومُوا خَيْرٌ لَّكُمْ ۖ إِن كُنتُمْ تَعْلَمُونَ

Sooratul-Baqarah; (2):184

[[Meaning: And as for those who can fast with difficulty, they have a choice either to fast or to feed a poor person for every day. But whoever does good of his own accord, it is better for him. And that you fast is better for you – if only you knew.]]

Then this was abrogated by the verse that came after it; and it was not permitted [to break the fast] except for the sick person and the traveler.

(3) And as for the third stage: then the proof for it is His saying in the following verse:

شَهْرُ رَمَضَانَ الَّذِي أُنزِلَ فِيهِ الْقُرْآنُ هُدًى لِّلنَّاسِ وَبَيِّنَاتٍ مِّنَ الْهُدَىٰ وَالْفُرْقَانِ ۚ فَمَن شَهِدَ مِنكُمُ الشَّهْرَ فَلْيَصُمْهُ ۖ وَمَن كَانَ مَرِيضًا أَوْ عَلَىٰ سَفَرٍ فَعِدَّةٌ مِّنْ أَيَّامٍ أُخَرَ

Sooratul-Baqarah; (2):185

[[Meaning: The month of Ramadan in which was revealed the Qur·aan, a guidance for mankind and clear proofs for the guidance and the criterion between right and wrong. So whoever of you is resident and sees the crescent on the first night of the month, he must fast that month, and whoever is ill or upon a journey, then an equal number of other days.]]

So these are the three stages; and the wisdom in that is: fasting contains something of difficulty upon the souls – so the legislation gradated; bit by bit – because everything that is difficult upon the souls then Allaah the Mighty and Majestic, through His Wisdom and His Mercy, causes it to become binding upon the servants bit by bit.

[1] Agreed upon. As occurs in al-Bukhaaree no. 1892 & Muslim no. 1125 from a narration of `Aaishah and Ibn `Umar radiyAllaahu `anhum.