The pilgrimage to «St. Mary in the rock» originated at the beginning of the 14th century, when, as legend has it, a young boy was miraculously saved by the Virgin Mary following a fall from a cave in the cliffs. Today, this cave is the location of the Chapel of Grace of the Virgin Mary. Pilgrims travel to the site from throughout Switzerland and neighbouring countries, and include members of a range of ethnic groups living in Switzerland (Albanians, Italians, Filipinos, Portuguese, Slovakians, Spanish and Tamils). Even some Hindu Tamils make the pilgrimage to Mariastein. The considerable appeal of this place of pilgrimage, which transcends ethnic and religious boundaries and thus facilitates integration, evolved without any specific promotional campaigns on the part of the institutions.
Aside from a hiatus during the period of the revolution, the Benedictine monks from the Beinwil monastery in the canton of Solothurn have been providing pastoral care for pilgrims since 1636. In 1648, the monks relocated their monastery to Mariastein, where it was finally closed in 1874 during the Kulturkampf (a period of conflict between the state and the Catholic Church). People continued to make the pilgrimage, however, and were still looked after by the Benedictines. The abbey and its community went into exile in France and later Austria, from where they were expelled in 1941. They were granted asylum in the old monastery, which was officially re-established by the government in 1970/71.