Different investors can simultaneously call a stock a winner and a loser, depending on the time frame each has in mind. For example, consider Pinterest (PINS -1.55%). The stock has more than doubled since it went public in 2019, handily beating the market. So, on one hand, it's a winner. But Pinterest stock is also down 21% so far in 2021 and down 42% from its all-time high. So, on the other hand, it's also a loser.

The ups and downs of Pinterest stock might leave some to wonder why stocks even go up and down in the first place. As we'll see, there's a very important factor that makes stocks go up over the long term. And the good news for Pinterest shareholders is that Pinterest is exhibiting this trait -- if you know where to look. Therefore, if you already own Pinterest stock, it may be time to buy more, considering its recent underperformance.

In a dark room, a person sits in front of a tablet device showing a stock chart.

Image source: Getty Images.

Simply explaining why stocks go up

There's a strong correlation between stock price and earnings. You may not always see it play out with particular companies over short time periods. But zooming out with a collection of companies, the correlation is undeniable.

Take the S&P 500 as an example. This index is a collection of roughly 500 of the largest, most profitable U.S. public companies. Over the past 30 years, the S&P 500 index hasn't risen at the exact same pace as earnings growth. But looking at the chart, you easily see the strong connection.

S&P 500 Earnings Per Share Chart

Chart shows data from last 30 years. Data by YCharts.

It may be more accurate to say stocks go up when there's increasing interest, or demand, from investors. However, investors love profits. So as profits increase, demand from investors grows.

But this is only true over the long term. Over the short term, the market can be fickle. Investors have a tendency to overreact to both bad and good news, creating upside and downside volatility. But the dust settles in time and always brings us back to this most important factor.

A person browses images on Pinterest's app using a tablet device.

Image source: Pinterest.

Why Pinterest stock can therefore go up

Profits are typically measured with net income according to generally accepted accounting principles (GAAP). In Pinterest's second quarter (the most recent), GAAP net income came in at just $69 million. Critics might point out that this is pretty meager for a company with a market capitalization of around $34 billion. Moreover, management said it expects third-quarter expenses to creep up, so net income may not be this high in Q3. But if net profits go down next quarter, shouldn't the stock come down as well?

Here's the thing: GAAP net income isn't always a great way to measure profit growth for companies like Pinterest. The previous chart was a helpful illustration because the S&P 500 represents companies that are more mature. These businesses are often prioritizing profits over revenue growth. Therefore, the correlation between net-profit growth and stock price is clear in that case.

Here's a chart that might be more helpful with understanding the trajectory of Pinterest's business. Rather than showing net-profit growth, it shows gross-profit growth.

PINS Chart

Data by YCharts.

Pinterest stock has most recently fallen because of the company's user metrics -- active users declined in Q2. That's concerning and I hope it doesn't become a longer trend. But the company is currently overcoming declining user engagement by improving user monetization. In Q2 revenue increased 125% year over year despite a smaller user base. And revenue is set to keep growing as advertisers increasingly see the value of Pinterest's platform. 

With revenue growth, Pinterest's gross profit margin is also expanding. In the first quarter of 2019, its gross margin was around 64%. Fast forward to Q2 2021, and its gross margin was 79%. Many expenses for Pinterest's platform are fixed. Therefore, as revenue has risen, so too has profitability. And this expanding gross profit margin explains why gross-profit growth is exceeding revenue growth.

In between gross profit and net profit, companies like Pinterest have choices to make about spending money. Pinterest is currently spending money testing new features for its platform, as well as expanding internationally. These kinds of things weigh on net profits for now. But over time, they could drive further revenue and gross-profit growth.

In other words, Pinterest's business is trending in the right direction. The stock has been a loser lately, and I'm sure there are more than a couple dissatisfied shareholders. But under the surface, Pinterest is expanding profits, and this strongly correlates with stock performance over the long term. Therefore, I'd recommend Pinterest shareholders stay the course for now. Moreover, if you already own some Pinterest stock, this recent pullback could be a great opportunity to add to your position.