Short answer
Because Ramadan follows the lunar Islamic calendar. Twelve lunar months add up to about 354 days, around 11 days fewer than the solar year, so Ramadan starts about 11 days earlier each year and passes through every season in roughly 33 years.
The months of fasting, Hajj and Eid are fixed by the moon, since Allah made the new moons measures of time. A month begins with the sighting of the crescent and lasts 29 or 30 days. Fixing Ramadan to solar dates is not valid.
The four schools agree on this.
Explanation
Allah says that the number of months with Him is twelve, and that the new moons are measures of time for people and for Hajj. Each Islamic month starts when the new crescent is seen and lasts 29 or 30 days. The Prophet ﷺ showed the month with his hands: sometimes twenty-nine days, sometimes thirty.
The arithmetic. A lunar year is about 354 days, while the solar year of the Gregorian calendar is about 365. So every Islamic date, including the start of Ramadan, comes about 11 days earlier each year on the Gregorian calendar. Over about 33 years, Ramadan passes through every season.
A wisdom in it. Scholars point out that no country is stuck with Ramadan always in the long, hot days of summer or always in the short days of winter. Over a lifetime, a Muslim fasts in every season, and Muslims in the north and south of the world share the easier and harder years in turn.
Can Ramadan come twice in one year? Yes, occasionally. Because the lunar year is shorter, Ramadan can begin in early January and again in late December of the same Gregorian year. The same is true of the two Eids.
For dates ahead, see the Islamic calendar and the Ramadan countdown. For when the month begins each evening, see does Ramadan start at sunset.
The evidence
Quran, Surah Al-Baqara 2:189
۞ يَسْـَٔلُونَكَ عَنِ ٱلْأَهِلَّةِ ۖ قُلْ هِىَ مَوَٰقِيتُ لِلنَّاسِ وَٱلْحَجِّ ۗ وَلَيْسَ ٱلْبِرُّ بِأَن تَأْتُوا۟ ٱلْبُيُوتَ مِن ظُهُورِهَا وَلَٰكِنَّ ٱلْبِرَّ مَنِ ٱتَّقَىٰ ۗ وَأْتُوا۟ ٱلْبُيُوتَ مِنْ أَبْوَٰبِهَا ۚ وَٱتَّقُوا۟ ٱللَّهَ لَعَلَّكُمْ تُفْلِحُونَ ﴿١٨٩﴾
They ask you, [O Muhammad], about the new moons. Say, "They are measurements of time for the people and for Hajj." And it is not righteousness to enter houses from the back, but righteousness is [in] one who fears Allah. And enter houses from their doors. And fear Allah that you may succeed.
The new moons set the times of worship, which is why Ramadan follows the moon.
Quran, Surah At-Tawba 9:36
إِنَّ عِدَّةَ ٱلشُّهُورِ عِندَ ٱللَّهِ ٱثْنَا عَشَرَ شَهْرًۭا فِى كِتَٰبِ ٱللَّهِ يَوْمَ خَلَقَ ٱلسَّمَٰوَٰتِ وَٱلْأَرْضَ مِنْهَآ أَرْبَعَةٌ حُرُمٌۭ ۚ ذَٰلِكَ ٱلدِّينُ ٱلْقَيِّمُ ۚ فَلَا تَظْلِمُوا۟ فِيهِنَّ أَنفُسَكُمْ ۚ وَقَٰتِلُوا۟ ٱلْمُشْرِكِينَ كَآفَّةًۭ كَمَا يُقَٰتِلُونَكُمْ كَآفَّةًۭ ۚ وَٱعْلَمُوٓا۟ أَنَّ ٱللَّهَ مَعَ ٱلْمُتَّقِينَ ﴿٣٦﴾
Indeed, the number of months with Allah is twelve [lunar] months in the register of Allah [from] the day He created the heavens and the earth; of these, four are sacred. That is the correct religion, so do not wrong yourselves during them. And fight against the disbelievers collectively as they fight against you collectively. And know that Allah is with the righteous [who fear Him].
The Islamic year is twelve lunar months.
Sahih al-Bukhari 1913
Sahih... إنا أمة أمية لا نكتب ولا نحسب الشهر هكذا وهكذا ...
"We are an unlettered nation; we do not write or calculate. The month is like this and like this."
The month is 29 or 30 days, set by the moon.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Kitab al-Sawm, chapter on sighting the new moon. The month of Ramadan is established by sighting the crescent or completing thirty days of Sha'ban.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.