A company's share price is theoretically determined by the summation of the company's expected future dividends as calculated by the Gordon growth model. The equation for the Gordon growth model, also known as the dividend discount model, is represented by the following:
Present value of stock = (dividend per share) / (discount rate - growth rate)
The equation above treats a stock's present value similarly to a perpetuity, because it is assumed the company's dividend payments are fixed and known throughout the life of the dividend payments. It is easy to see, however, that although a stock price is conceptually determined by its expected future dividends, many companies do not distribute dividends. Many market forces also contribute a company's stock price.
Generally speaking, the stock market is driven by supply and demand, much like any market. When a stock is sold, a buyer and a seller exchange money for share ownership. The price for which the stock is purchased becomes the new market price. When a second share is sold, this price becomes the newest market price, etc.
The more demand for a stock, the higher it drives the price, and vice versa. The more supply of a stock, the lower it drives the price, and vice versa. So while in theory, a stock's initial public offering (IPO) is at a price equal to the value of its expected future dividend payments, the stock's price fluctuates based on supply and demand.