The Prophet's Mosque began as a house, and its expansion into one of the largest mosques on earth happened almost entirely after the person it was built around had died.
From a house to a monument
The mosque originated as the residence and adjoining prayer space of Muhammad in Medina after his migration there in 622, with his tomb later located beneath what became known as the Green Dome. Successive caliphs and later the Ottoman and Saudi states expanded the structure repeatedly, most dramatically under twentieth century Saudi renovation projects that increased its capacity to accommodate well over a million worshippers during peak pilgrimage periods, dwarfing the modest original building by an enormous margin.
A garden between two points
A specific area within the mosque, the Rawdah, lying between Muhammad's tomb and his pulpit, is described in hadith tradition as one of the gardens of paradise, and pilgrims specifically seek to pray within its bounds, though its limited floor space and heavy demand mean access is often managed through timed entry systems during busy periods.
Not part of the pilgrimage obligation, but close to universal in practice
Visiting the Prophet's Mosque is not a formal requirement of Hajj or Umrah, but the overwhelming majority of pilgrims to Mecca extend their journey to Medina specifically for it, making the mosque a near-universal second stop rather than a strictly separate destination.