Even back then, game console manufacturers had licensing agreements with developers, so those developers had to pay royalties, even though distribution was handled by physical stores.
In some cases, some console manufacturers even handled the manufacturing of cartridges/CDs and the distribution side too.