TL DR: The emulator is a copy of the console and the ROM is a copy of the game. The files of these games are pulled off of retail release copies and are mostly called ROMs or ISOs depending on the console’s software medium. An emulator is a piece of software that mimics the console hardware of game systems past, allowing other hardware to run games that were specifically built for another machine. To start off, let’s assume you don’t know anything about emulation. Okay, now that the narcs are gone, let’s play some damn video games. You are morally superior to us all and can close this tab.
Go forth, rich person, and pay for Sonic the Hedgehog 2 for the twelfth time in your life. If you’d like to live your life within the confines of the PlayStation Store, Nintendo Switch Online, or the Google Play or Apple App Store, I cannot stop you. If you are a scared baby and cannot handle some gray market hi-jinx, I will direct you towards your local where you can purchase a variety of Classic or Mini consoles and game compilations. No, downloading other people’s copies of games you don't own is definitely not legal. Yes, 'backing up' games is entirely legal and downloading other people's backups of games you already own might be legal (but nobody has tested it in court). Yes, emulation software is entirely legal. I will begin this guide by asking you to check your internet law degree at the door.