Music in video games these days is typically produced like any other music, but when games came on cartridges, there wasn’t room for music recordings, and video game consoles had to make the music themselves.
Take the original Nintendo. The system’s CPU could make five different sounds simultaneously: two square waves, a triangle wave, noise, and a digital sample. Not much individually, but put it all together, and it starts to actually sound like music.
The Sega Genesis improved upon this by getting a dedicated music synthesizer. This chip was essentially the same as Yamaha’s DX7 synth used so much in music from the 80s - think A Ha’s Take On Me or Broadway’s Les Miserables. It was harder for the programmers to use, but it resulted in a fuller, funkier sound, like in Sonic 3’s Launch Base Zone and Streets of Rage 2’s Go Straight.
The Super Nintendo took a different route - using instrument samples to construct music from tiny little clips of each instrument’s sound. This resulted in a much different sound that wasn’t always as clear as the Genesis, but easier for composers to work with.
Once video games started coming on CDs, and then DVDs, this generated music started to give way to music produced and recorded in a studio. This gives composers infinitely more flexibility, but maybe at the expense of producing a less memorable product.