After years of underperforming its key rival, FedEx Corporation (NYSE:FDX), United Parcel Service (NYSE:UPS) stock is managing to eke out an outperformance, and it's also slightly positive in 2018 as I write. What's more, most of the move took place after the recent second-quarter results. Clearly, UPS is doing something right. Let's take a look at what that is and why it might prove to be a catalyst for future stock improvement.

UPS electric vehicles

Image source: United Parcel Service website.

UPS and FedEx: similar but different

The parcel delivery giants obviously have a lot in common, but what's less well known is that they are structured rather differently. Specifically, FedEx operates separate air and ground networks, while UPS operates an integrated network. In the past, FedEx has lauded the distinction as being one of the key reasons why FedEx has dealt better with the strains of burgeoning e-commerce demand, particularly during peak season.

On the other hand, UPS's structure has led to consistently lower capital spending compared to FedEx, and consequently, its free cash flow generation has been better over the years. Moreover, UPS tends to generate a far better return on invested capital than FedEx.

UPS CAPEX to Revenue (Annual) Chart

PS CAPEX to Revenue (Annual) data by YCharts.

Understanding these points about UPS will help us elucidate what's been going wrong at UPS in the last few years.

Where UPS lost its way

When comparing the performance of the two companies over the years, there's a palpable sense that UPS's network and previous levels of capital spending were ill preparing the company for the strain of dealing with e-commerce volume growth. As a consequence, UPS seems to have been reacting to events rather than getting out in front of them.

Evidence of this comes from the pointing fourth-quarter 2017 results, whereby, once again, UPS was forced to increase expenses in order to support its network during peak delivery periods in the holiday season -- the company took on an additional operating expense of $125 million, which led to total operating profit rising by just $71 million in the quarter.

In addition, UPS has been forced into increasing capital expenditures (see chart above), and CFO Richard Peretz expects it to stay at a high level -- between 8.5% and 10% of revenue for the next few years. Meanwhile, FedEx has done a better job than UPS of dealing with margin pressure from e-commerce growth -- online deliveries can involve bulky and/or inefficiently packaged items, and business-to-consumer (B2C) deliveries to residential addresses are seen as a relatively low-margin activity. 

There's little doubt that UPS has been caught flat-footed by events. The capital spending ramp-ups have disappointed investors, and there didn't appear to be a clear strategy for managing margin by balancing pricing increases with volume growth. 

So what's new

The good news from the second quarter is that UPS seems to have recognized the need to address these issues, and investors can take heart that it's back on track. Here are three key points on the matter.

First, management reiterated it would be making "transformational initiatives" in order to "drive greater operating efficiency, improved returns and continued growth in key targeted segments," with CEO David Abney citing the launching of a voluntary retirement plan as an early example -- Abney will extensively outline more initiatives in September.

Second, CFO Richard Peretz outlined that a $900 million improvement in working capital led to management raising its free cash flow 2018 guidance to $5 billion from a previous range of $4.5 billion to $5 billion. Peretz argued that it was a consequence of taking a "more global approach to our working capital and accounts payable" as part of its transformation initiative.

Third, UPS appears to be preparing itself to better manage margin in the future. Peretz highlighted the fact that "yields expanded in each of our major products" as UPS took "pricing actions to better align our cost to serve with the value we create for our customers."

As you can see below, average revenue per piece increased 3.8% in the second quarter, while volume growth declined to 2.6% -- a sign that UPS might be willing to forego some volume growth in favor of better pricing and possibly better margin.

UPS U.S. domestic package yield vs. volume

Data source: United Parcel Service presentations. Chart by author.

Investor takeaway

UPS's second-quarter results were solid enough, but the real story relates to the progress in the underlying objective of transforming the business. Looking ahead, UPS will host a Transformation Conference on Sept. 13, and investors will then learn just how UPS plans to improve efficiency and generate growth for shareholders.

UPS's management is now addressing the need to make higher capital expenditures while improving productivity, and the company is being more aggressive on pricing. For the first time in a while, UPS looks like it's getting into shape.

Lee Samaha has no position in any of the stocks mentioned. The Motley Fool recommends FedEx. The Motley Fool has a disclosure policy.