United Parcel Service (UPS -0.20%), well known for its brown-clad delivery crew, has seen its stock price advance by around 20% over the past three months. That's more than triple the gain of the S&P 500 index over the same span. There were good reasons for that short-term outperformance, but there's also a big-picture problem that investors still need to consider.

UPS had solid numbers in Q2

As this year got underway, investors' fears that an economic downturn was in the cards intensified. Traders responded by selling off a wide range of stocks, leading to a bear market. UPS fell largely in sync with the S&P 500, at one point dropping by more than 25% from its 2022 peak.

However, its second-quarter results were pretty solid. Revenue was up 5.7% year over year, adjusted earnings per share rose 7.5%, and management reaffirmed its full-year guidance. It also highlighted plans to increase its stock buyback target for the year. These were all positives, and traders jumped back into the stock. 

Only there are still risks here. While people and companies aren't going to suddenly stop shipping things anytime soon, that recession folks were worrying about early in 2022 is still a very real possibility -- and if it occurs, it would likely dent demand for the services UPS provides.

Interest rates on the rise

To simplify a complex issue, after years of extremely loose monetary policy and ultra-low interest rates intended to stimulate the U.S. economy, the Federal Reserve is hiking interest rates rapidly to combat inflation. While Wall Street was excited to see the last inflation reading indicate that price growth has slowed, the fact is inflation remains high. It's therefore likely that the Fed will keep boosting interest rates. If that does what the central bank intends, it will tap the brakes on economic growth a bit, and dampen inflation as demand slows. But if the Fed taps the brakes too hard, it could easily push the economy into a recession. In fact, if history is any guide, a recession may be exactly what's required in order to bring inflation back down to an acceptable range. Trying to balance low inflation and low unemployment is not an easy task.

While the 2020 pandemic-triggered recession was unusual for its extreme briefness -- it lasted just two months -- the prior two recessions had somewhat predictable impacts on UPS' earnings. Using trailing-12-month figures (since the company's business is seasonal), its earnings declined steadily during the recession of the early 2000s and plunged during the 2007-to-2009 downturn --- aka, the Great Recession. When economic activity slows, so does UPS' business.

UPS Chart

UPS data by YCharts

To be fair, the company has endured other periods of weakness. Basically, it has been trying to keep up with demand as the use of e-commerce has grown. That's resulted in a need to expand and upgrade its system, which hasn't always been an easy task. It is in a much better position today, business-wise. But the basic business hasn't really altered. If people and companies buy less stuff -- as happens during a recession -- there's less need for shipping.

UPS Chart

UPS data by YCharts

On top of that, the tight labor market is compelling employers to boost pay to attract and retain workers. So far, UPS has been able to offset its rising costs -- for labor and everything else -- by increasing its prices, but an economic downturn could make it harder for the company to keep passing those expenses on to its customers without consequence. So a recession could actually lead to two problems -- falling demand and higher costs.

A great company

This isn't to suggest that UPS is a bad company. It isn't. In fact, it has a strong history of success, including more than a decade of annual dividend increases. The most recent payout boost, a huge 49% hike, suggests that management is upbeat about the future. That, however, speaks more to the long term. If you are looking at the stock right now in the wake of its strong rebound relative to the market, you should think carefully about what a recession could do to the company's performance and its stock price.