The song was first composed by Toby "Radiation" Fox for EarthBound Halloween Hack, a hack of the SNES game EarthBound. It was mainly inspired by the song "Megalomania" from the SNES J-RPG Live A Live by composer Yoko Shimomura (Street Fighter II: The World Warrior, Super Mario RPG, Kingdom Hearts), as he originally intended to directly use that song for his hack but encountered technical difficulties.
Toby Fox reused the song a few years later in the webcomic Homestuck, for which he was a composer. Finally, the song appeared again during a boss fight in the game Undertale, created by Toby Fox himself.
Following the immediate success and critical acclaim of Undertale online, "Megalovania" became one of the most popular songs from the game, receiving millions on views on YouTube across dozens of different versions. As such, in the Nintendo Direct of September 4, 2019, this soundtrack received a new arrangement made by Toby Fox for Super Smash Bros. Ultimate's Sans Mii costume in the Ver. 5.0.0 update.
On the SiIvaGunner channel, Undertale songs are a recurring joke, and the most used song is "Megalovania".
"Megalovania" is also associated with the character Sans, and thus is sometimes used as a (less than friendly) reference to a certain Game Theory episode. The song has also been used as clickbait for rips such as "Megalovania (OST Version) - Undertale" and "Megalovania (Beta Mix) - EarthBound Halloween Hack", in which Chad Warden calls out the SiIvaGunner fan base for dislike-bombing rips.
In addition, there also are rips of "Megalomania" from Live A Live on the channel, which are generally associated with "Megalovania".
EarthBound Beginnings/MOTHER • EarthBound • MOTHER 1+2 • MOTHER 3
Frequently Ripped Tracks
Undertale • Deltarune
Super Smash Bros.: Ultimate
Unlicensed: Yellow • TS!Underswap • YandereTale
Fake: Undertale 2