How? The same way they get rid of old furniture and stuff. They just sell stuff they don't use after a while.
And yeah, many companies have their own library of games for... reference. Someone at DigitalPress found a bunch of Square games that were the property of Sunsoft, I think. They were no different from the retail versions.