If one were to ask a group of investors what factors drive the stock market, any number of answers might emerge. Fear and greed. The Federal Reserve. Interest rates. The business cycle. All of these are partial truths—the market is certainly influenced by all of these factors. But ultimately, what matters most to stock prices are corporate earnings (that is, profits).

The importance of earnings to stock prices is likely more obvious to those who invest in individual stocks rather than mutual funds. Mutual-fund investors often are shielded from the big price swings that result from an individual company falling short of (or exceeding) investors’ earnings expectations. It’s not unusual for a stock price to soar or plummet based upon a surprising earnings report.

But the earnings-stock price connection isn’t always straightforward. That’s because investors are willing to pay more for each dollar of corporate earnings when they are optimistic about the future, but less for each dollar of earnings when they are pessimistic. This optimism/pessimism applies to individual companies, specific industries, and ultimately to the market as a whole.

All of this is to say that it isn’t automatic that the stock market will fall when corporate earnings drop, or rise when earnings rise—at least in the short-term. But in the long run, the market’s performance can stray from the performance of corporate earnings only up to a point. Ultimately, stock ownership is company ownership, and the profitability of those underlying companies matters—a lot.