"I give you 30B$ worth of hardware that costs me <10B$ to make in exchange for 30B$ worth of shares in your company" would be a more accurate description.

How does this work with private companies? It feels like Nvidia could find that the market does not value OpenAI stock the same way they did.

Public or private, there's never a guarantee of being able to sell back for some nominal price.