It's no lie that Mario music is reused more than Sonic music, though. The vast majority of cave levels will have some variation of that SMB1 bass line. And a lot of Mario games have, for example, an overworld theme that's played on multiple stages throughout one game, an athletic theme (often remixed from SMB3) that plays in multiple stages and a Bowser/castle theme that plays in the last stage of every world. Out of the mainline Mario games, only Galaxy doesn't completely fall into this formula.
Adding on to this, Super Mario World and NSMB have one central melody that is remixed multiple times. Every stage but the boss themes have that motif in SMW. And of course, three out of four NSMB games have the exact same musical arrangements throughout, with NSMBU having a few new tracks and NSMB2 adding more "bah" sounds and calling it a day. The only original piece of music in NSMB2 is a remix of Super Mario World's boss theme.
With Sonic, usually you get two arrangements of one track, which exclusively plays in that one world. And it's rare to hear a remixed stage theme unless you're literally revisiting this stage. For example, Green Hill, Emerald Hill, Seaside Hill, Splash Hill and Windy Hill all blatantly take after each other, but the only time you'll hear Green Hill's music is in the gens and mania versions of that stage. Off the top of my head, the only music you're guaranteed to hear in a Sonic game is
this or
this.