Mostly, they buy them.
Retailers purchase stock from publishers and distributors, then resell those copies to customers, which is how new games end up on store shelves.