You have heard about emulation, haven't you?
Not depending on original hardware is what all the emulators like DosBox, Snes9x, Vice, fceux, pcsx-reloaded, pcsx2, etc... are for. Compatibility layers like WINE make really old Windows games run under Linux while they don't even run on modern Windows anymore, etc... Even the handheld scene has compatibility layers like GINGE and emulators. Even a 3DS-XL can play NES, GameBoy, GameBoy Color amd GameBoy Advance just fine. Big companies don't care for backwards emulation since they aim to be able to sell the same games to the same people over and over again, but there are always enough people trying to preserve things by excellent work they are mostly even doing for free.
Of course OpenSourcing software after a reasonable amount of time would be a way to go too (any program could be ported to modern hardware this way) but since not many companies are willing to do that, emulation it is.
Without DosBox, GoG would need to get the devs and rights holders of the old games here write new ports or open source their code and let GoG take care of porting, so even GoG is strongly depending on emulation right now and while the commercial use of it is a new trend, emulation itself isn't, because not many people really want to have 5 generations of computers at home or give up their old games.