1. You don't need a $300 GPU to play modern games on a gaming PC.
2. Sony and Microsoft subsidize the cost of the hardware. They lose money on every console that goes out the door and make their cash on online passes, accessories and individual games. After a couple years the cost to produce goes down and they start to make some margin on them.
This is the way they've been doing it for several console generations now.