The Maha Mantra first appears in the Kala Santarana Upanishad, so let’s look at the beginning…
(1)At the end of the Dvapara (Yuga), Narada went to Brahma and addressed him thus; "O
Lord, how shall I, roaming over the earth, be able to overcome the effects of Kali (Yuga)?" Brahma replied thus; "You have asked well. Listen to that which all the
Vedas keep secret and hidden, through which one may cross the ocean of mundane existence (samsara) during Kali (Yuga). It is through the mere recitation of the names of the Primeval Personality of Godhead - Lord NARAYANA, that one transcends the evil effects of the Kali Yuga.
Narada asked again: "What are those names?" Brahma (Hiranyagarbha) replied;
Hare Krishna Hare Krishna Krishna Krishna Hare Hare
Hare Rama Hare Rama Rama Rama Hare Hare
These sixteen names destroy the negative effects of Kali. No better means (upaya) than
this is to be had in all the Vedas.
These sixteen names destroy the 16 envelopments (kala) in which the jiva is enveloped
(avarana). Then like the Sun which shines forth once the clouds are dispersed,
Parabrahman alone radiates forth.