﴿يَا أَيُّهَا الَّذِينَ آَمَنُوا كُتِبَ عَلَيْكُمُ الصِّيَامُ كَمَا كُتِبَ عَلَى الَّذِينَ مِنْ قَبْلِكُمْ لَعَلَّكُمْ تَتَّقُونَ﴾ [البقرة:183]
183 - O people who have believed, Fasting was prescribed on you as it was prescribed for those who were before you from the People of the Scriptures in order that they obey Allah, fear Him and keep away from the things that He prohibited. Fasting contains upbringing, self-purification, and education to obedience and compliance.
﴿أَيَّامًا مَعْدُودَاتٍ فَمَنْ كَانَ مِنْكُمْ مَرِيضًا أَوْ عَلَى سَفَرٍ فَعِدَّةٌ مِنْ أَيَّامٍ أُخَرَ وَعَلَى الَّذِينَ يُطِيقُونَهُ فِدْيَةٌ طَعَامُ مِسْكِينٍ فَمَنْ تَطَوَّعَ خَيْرًا فَهُوَ خَيْرٌ لَهُ وَأَنْ تَصُومُوا خَيْرٌ لَكُمْ إِنْ كُنْتُمْ تَعْلَمُونَ﴾ [البقرة:184]
184 - It is for a fixed number of days.
that fasting was at the beginning of Islam. They used to fast three days of each month, then the fasting was abrogated by the fasting of Ramadan as will be mentioned in the following Ayah.
The meaning of the fixed number of days may be the days of the month itself in compare to the days of the year out of belittling them in the eyes of the fully competent people.
Those who are sick in a matter that harms fasting or it is difficult with it to fast or were traveling a far distance that necessitates shortening of Salah, there is no harm on him to make up what they missed later on.
As for those who fast it but with hardship such as the old people and the sick whose sickness is incurable, they have to feed a needy person for everyday they did not fast; it will be the amount of the food which a person regularly eats everyday. However, those who give more, it will be better for them.
Fasting is better for those who were given the permission to break their fast if there is no difficulty for them.
If you realized this and were of the people of knowledge and consideration, you would certainly know that fasting is better than breaking it.
There is another explanation to Ayah which is the view of the majority. Muslims at the beginning of Islam were given choice between fasting some days or feeding the needy. So, the meaning of the Ayah will be: Those who can fast but break their fast have to pay a ransom. Then the Ayah was abrogated and the ransom was made upon those who are unable to fast.
﴿شَهْرُ رَمَضَانَ الَّذِي أُنْزِلَ فِيهِ القُرْآَنُ هُدًى لِلنَّاسِ وَبَيِّنَاتٍ مِنَ الهُدَى وَالفُرْقَانِ فَمَنْ شَهِدَ مِنْكُمُ الشَّهْرَ فَلْيَصُمْهُ وَمَنْ كَانَ مَرِيضًا أَوْ عَلَى سَفَرٍ فَعِدَّةٌ مِنْ أَيَّامٍ أُخَرَ يُرِيدُ اللهُ بِكُمُ اليُسْرَ وَلَا يُرِيدُ بِكُمُ العُسْرَ وَلِتُكْمِلُوا العِدَّةَ وَلِتُكَبِّرُوا اللهَ عَلَى مَا هَدَاكُمْ وَلَعَلَّكُمْ تَشْكُرُونَ﴾ [البقرة:185]
185 - The month of Ramadan during which Allah had revealed the Glorious Qur'an, in the Night of Revelation, as guidance for people from misguidance of disbelief to faith. The Qur'an contains clear Ayahs that guide to the truth, prescribed penalties, rulings for those who consider and believe in them truly. By these Ayahs, people can distinct between the truth and the falsehood and between the lawful and the prohibited.
Therefore, Allah had chosen this month for Muslims to fast, so those who attend it while being non-travelling and healthy, they have to fast the whole month.