A stapler's price is much lower than its value, but because lots of people make staplers, the price is closer to its cost. Same with restaurants etc.
But an iPhone and MacBook has less competitors so it's priced closer to value.
Engineers are a middle ground. In SF, you can get a top notch engineer easily. The price becomes more cost-based - how much does it cost for someone to live there, or what is the competition offering.
In something like Kuala Lumpur, the number of engineers who know Big O are rare. So it's more value based - how much money does the engineer bring to the company.
But even so, the cost based pricing in places like SF is a lot higher than value based pricing elsewhere. After all, the reason prices are so inflated there is because all the money sloshing through tech giants and VCs.