The 8-bit sonic games were originally made with the Game Gear in mind. Because the Game Gear and Master System have nearly identical hardware (except for a different screen size and palette), Master System ports were made as well.
It is true for Sonic 1, but Sonic 2 is infamously difficult on Game Gear, because the levels where designed with the Master System in mind, and it didn't port well to the smaller Game Gear resolution (160x144 vs 256x192): the assets are the same size, so the effect is almost like a truncated viewport.
There was even the "Master Gear" which let you play master-system games on the game gear. I played the first Phantasy Star game that way.