In a very roundabout way, RAM being a valuable item isn’t too far off from bitcoin
The hashrate is determined by the price of bitcoin, the price of electricity, and the price of ASICs.
That's the price of bitcoin, not the cost. Price is what you can sell it for, cost is what you can make it for. The cost is determined by the price of the inputs, which are electricity and ASICs.
So in this case, the price determines the cost, not the other way around. People will invest money into creating bitcoins until their cost of acquisition equals the price they can sell for, and this effort purely drives up the cost without generating any additional bitcoins.