We don't actually know what a company is worth. You can imagine estimating the worth (a.k.a., "net present value") of a company based on its future dividends (or stock buybacks). But any formula will contain a lot of probabilities of when each dividend will occur, the amount, and the discount factor (that is, how much future money is worth today). So what you get is actually a distribution of how much a company is worth.
The stock market doesn't deal with distributions directly. It uses options. A call option is the ability to buy a stock at a given price called the "strike price". So, from the prices for two call options, you can infer the probability that the stock's worth is between their strike prices.