That's because the price isn't "Costs plus a markup", it's "Whatever the market will bear"
"The Market" is the magical part. Price is absolutely not less than cost--you can't stay in business spending $1000 to build computers that you sell for $10, although strategic undercutting happens (10 million volume manufacturer sells at a loss to put 10 thousand volume manufacturer out of business), as well as loss-leader strategies (sell the coffee maker cheap; overcharge on the coffee).
Competition forces the price down to the former by giving the market a choice
Which means if you have the means to produce at a lower cost than any competitor, competition will not lower prices; indeed, you can undercut competition below their costs, driving them out of business.
That means competitive markets are strange beasts, especially with rising costs: if the producers charge $1000 for a product that costs $300, $500, and $700 to produce, rising costs can push you up to $350, $580, $820, and yet the price can stay around $1000 because Mr. $350 doesn't see a need to raise prices yet, and Mr. $820 is trying to cut his costs back by any means necessary. Soon Mr. $820 will have costs over $1000, and will sell his business to a competitor--Mr. $350 will have the most spare capital, and be able to make the best bid.
Let the $820 guy find out how to make shit for $500, and he might undercut the market in a bid to get more market share and attempt a hostile take-over of the $580 business. Maybe not. In any case, a fourth player can make the product for $1100, but market price is $1000, so he can't enter the market.