The devs determine they need to sell X copies at Y$/copy, they then calculate what Valve's cut will be and add it over Y$
Example: You think you'll sell a million copy and want to make 10 millions to recoup your cost and make a profit so you need 10$ per. But the truth is that after everyone else gets their cut (publisher, distributor, taxes...) you're left with about 50% of the sale price going to you, that means your need to sell the game for 20$ to end up with 10$/copy going to you. If everyone else had lower margins and you got 70% of the sale price ending up in your pocket you would need to sell your game for 14.30$ a copy to end up with 10$ going to you. Everyone else in this example are the people who aren't part of the actual development cost, their margins are huge compared to the amount of work they accomplish, the proof of that is that they're making billions in profit, profit is revenue - cost, their cost is basically nothing, hosting content and distributing it costs peanuts these days and prices are only going down, so their profit is actually increasing passively over time. Because the devs need to set the price at 20$ instead of 14.30$ you're paying 5.70$ more for the same product and that 5.70$ is all going into the pockets of people that had nothing to do with actually creating the product you're purchasing.
I'm talking about Steam because that's what this part of the conversation is about, funny how that works, right? I'll be the first one to call out any company who's owner/c-suite are billionaires. If we want to talk about PC gaming specifically then Epic is no better, neither is GOG. Decentralize that shit.