Madinah was Yathrib then, an oasis of farms and wells where two Arab tribes quarrelled and waited, without knowing it, for an arbiter they could trust. The city's elders had met the Prophet at the trade fairs of Makkah; when persecution made Makkah unbearable, they sent word: come to us, and what is ours is yours.
The migration itself is one of the great journeys of history. The Prophet slipped out of Makkah with Abu Bakr, sheltered three nights in the cave of Thawr while riders combed the country for them, and travelled north by unfamiliar coastal routes. The distance that today's train covers in under two hours took the Hijrah, by camel and detour, the better part of two weeks.
What happened on arrival defines the city you will walk through. The Prophet built a mosque with his own hands — palm trunks for pillars, a roof of palm leaves — and the mosque and his household stood at the centre of a new community: migrants from Makkah sharing everything with the helpers of Madinah, a charter written for Jews and Muslims as one polity, and a mosque that was also a school, a court and a home for the poor.
Makkah was conquered years later and the Kaaba rededicated, but the Prophet returned to Madinah and was buried here, in the room beside the mosque he had built. The city kept his mosque as its heart, and every expansion since — the caliphs, the sultans, the kings — has been an act of care around that one room. When pilgrims say Madinah feels like coming home, this is the history under the feeling.