What happened

Shares of United Parcel Service (NYSE:UPS) climbed 11.1% in June, according to data provided by S&P Global Market Intelligence. Although the company has hardly been a world-beater in recent years, UPS continues to benefit from the constant comparisons between it and archrival FedEx (NYSE:FDX).

So what

UPS shares, like those of many of the transports, got a boost early in June: Tensions eased between the U.S. and Mexico, and the threat of new North American tariffs faded. A softening of rhetoric between the U.S. and China helped as well.

More broadly speaking, UPS seems to be getting the better of comparisons with FedEx. In June FedEx ended an express contract with Amazon.com, opening up the potential for more package volume to flow through UPS's network. And it was FedEx, not UPS, that got caught in the crosshairs of a conflict between the U.S. and China over Huawei.

A UPS Boeing 747 cargo plane in flight.

UPS was flying high in June. Image source: United Parcel Service.

But UPS shares did get a lift when FedEx reported fiscal fourth-quarter results that, while down year over year, beat Wall Street expectations.

Investors tend to look at UPS and FedEx in tandem. And right now, UPS is benefiting from FedEx results indicating that global shipping headwinds, while still present, are not getting any worse. It's also enjoying the benefits of FedEx's stumbles.

Now what

The June jump is nice, but UPS still trails the S&P 500 by 13 percentage points for the year; over the past five years the company's shares have gained an anemic 6%, well below the S&P 500's 50% gain during that period. This is true even though the company has been generously returning cash to shareholders: UPS returned $1.1 billion in share repurchases and dividends in the first quarter of 2019 alone.

UPS is in the middle of an ambitious plan to spend upwards of $20 billion on new facilities, vehicles, aircraft, and technology through 2020, all of which should leave it well-positioned to continue to grow its business. The payoff on that spending might not occur right away, and trade issues or a slowing economy could be headwinds. But even after the June surge, investors are enjoying a 3.76% dividend yield while they wait.

UPS isn't a business that can offer monthly gains of 10% or more, but for long-term holders, there's a lot to like about the course the company is taking.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.