What happened

A Wall Street analyst says demand is holding up well for trucking company XPO (XPO -6.22%), even as a competitor is at risk of driving into a ditch. The analyst upped his price target on the stock and investors followed, sending shares of XPO up as much as 14% for the week, according to data provided by S&P Global Market Intelligence.

So what

The trucking industry has been on a wild ride in recent years. A surge in demand following the pandemic created supply chain bottlenecks and delays. More recently, fears of a global slowdown caused by higher interest rates have led to worries that demand for trucking could collapse.

The industry is also bracing for the possible fallout of a potential Yellow bankruptcy and United Parcel Service strike. Earlier this week, Yellow deferred its required contributions to its pension plan, a move that could trigger a strike by its workforce and could push the company into bankruptcy. UPS, meanwhile, has until the end of the month to resolve its differences with workers or face a work stoppage.

All of these threats are causing freight patterns to shift, as large customers don't want to be caught off guard if the trucks stop. That should be good news for companies like XPO.

On Monday, Barclays raised its price target on XPO to $70 from $55, keeping an overweight rating on the shares. Analyst Brandon Oglenski wrote that while Yellow's issues are dominating the headlines, trucking fundamentals are actually "proving resilient."

Now what

XPO shares have been in the fast lane for some time now, with the stock up 45% since the beginning of June. The company needed some time to get its footing after a pair of spinoffs that simplified operations around trucking, but it's making strong moves to get on track. Earlier this year, XPO hired a longtime executive from industry-leader Old Dominion Freight Line as chief operating officer, with a mandate to wring out costs and improve efficiency.

No trucking company can power through an industrywide recession, so XPO's fate from here is somewhat tied to how the economy evolves. But XPO is beginning to establish itself as one of the top players in the industry and appears well-positioned to pay off for investors willing to hold through the cycles.