According to the legend this basilika was built after the Pope Liberius had a dream, in which the Holy Virgin was asking him to build a church if it had fallen snow on the following morning;
Religious - Christianity
The day was 5th of August so it was considered a miracle if it snowed. The miracle did happen and Santa Maria Maggiore was built.
This happened in the century of 350 and the basilika was rebuilt several times during the following popes.
The basilica is also known as Basilica Liberiana after the founder, Santa Maria ad Praesepem (because the relics of the Infant Jesus’ cradle are treasured there), Santa Maria Maggiore (because it excels among all Roman basilicas consecrated to the Blessed Virgin) and Santa Maria della Neve, Our Lady of the Snow, after the miracle.