Switch: ~$40 profit[1]
PS4: ~$18 profit[2]
Xbox One: ~$30 profit[3]
As for software, a Forbes estimate from 2006 put the console manufacturer cut at around 11.5%, however that could be different nowadays.
This also changes with exclusivity deals in which the fee is presumably waived. I believe Sony would gain a little extra from licensing the Blu-ray technology on top of that.
But yeah, you're right. Much like printers and ink cartridges, the money is in the contents, not the device.
Disclaimer: I'm not in any way a part of the industry, just an interested fan of the medium so take this with a grain of salt and feel free to provide any knowledge you might have
[1]: https://www.polygon.com/2017/4/5/15195638/nintendo-switch-co... [2]: http://allthingsd.com/20131119/teardown-shows-sonys-playstat... [3]: http://allthingsd.com/20131126/microsofts-xbox-one-cost-90-m... [4]: https://www.forbes.com/2006/12/19/ps3-xbox360-costs-tech-cx_...