General Motors(NYSE:GM) shares have had a good run in recent months. There's a growing sense among Wall Street analysts that GM might have a leg up on its key rivals, particularly Ford Motor Company (NYSE:F), Fiat Chrysler Automobiles (NYSE:FCAU), and to some extent, Toyota Motor Corporation (NYSE:TM).

What's giving GM the advantage? Simply put, CEO Mary Barra and her team have been working to stack the deck against these and other rivals with smart investments in products for today and technologies for the future. 

The investment case for GM has two parts, and both show how the General has found a leg up on its key competitors. Let's take a closer look.

Mary Barra speaking at a podium in front of a backdrop with General Motors' logo.

While investors have focused on other automakers' bold promises, CEO Mary Barra has quietly put GM ahead of the pack. Image source: General Motors.

How GM is stacking the deck today

In the near term, GM's profits and margins stand to grow because it has (or soon will have) the freshest products in the most profitable segments of the market:

  • GM just finished launching a slew of new crossover SUVs, just as demand for crossovers is hitting new highs in both the U.S. and China. GM's new crossovers are both very competitive and more profitable than the products they replace. The effects are already showing up on GM's bottom line.  
  • GM has all-new versions of its full-size pickups coming next year. Those will be followed by all-new versions of its midsize pickups and big truck-based SUVs. These are all massively profitable products that (as a group) sell in huge numbers, and -- as with the crossovers -- GM expects the new models to be even more profitable than the current models.
  • GM has more crossovers coming: These will be three all-new models for the Cadillac luxury brand, arriving over the next couple of years. They'll expand Cadillac's product line into new high-volume territory. They should sell very well in both the U.S. and China, at very strong prices. 

Of course, Ford and FCA are also strong contenders in pickups, and they (and Toyota) have solid crossover entries. But simply put, GM beat them in investing aggressively in new products aimed at the most profitable global market segments: The others look a step or two behind. 

A red 2019 Chevrolet Silverado pickup truck in a desert setting.

The all-new 2019 Chevrolet Silverado, due next fall, should give GM's truck profits a boost. Image source: General Motors.

At the same time, Barra has been much more aggressive than rivals in trimming less profitable programs, by exiting market segments (or even entire markets, like Europe) in which the returns aren't sufficient. 

How GM is stacking the deck for tomorrow

Starting in a couple of years, GM's leading positions in two key technologies will give it the opportunity to build new businesses that add to, rather than replace, the profits generated by those new products:

  • GM is out in front of the emerging trend toward electric vehicles. It was the first to ship an affordable, long-range battery-electric car (the Chevrolet Bolt EV), beating Tesla (NASDAQ:TSLA) by several months. It'll follow the Bolt with at least 20 more all-electric vehicles over the next 6 years. Most of those will be built on an all-new architecture that GM promises will deliver solid profitability, something that has so far eluded nearly all electric-vehicle rivals. 
  • GM is also out in front of self-driving technology. It has a self-driving version of the Bolt ready to enter mass production as soon as its software is shown to be consistently safer than a human driver, something that GM estimates will happen in 2019. 
  • Those mass-produced self-driving Bolts will be put into ridesharing service in dense urban environments. Because the self-driving system improves as it racks up mileage, GM believes that its ability to quickly put thousands of self-driving vehicles on the roads will result in rapid improvements, and that ridesharng customers will gravitate to the services with the best systems. If GM can be first (or even second) to bring self-driving vehicles to market at scale, which seems likely today, that could lead to an enduring advantage

How does that compare? Ford and Toyota have electric-vehicle programs underway, but neither is as advanced (or as ambitious) as GM's. Likewise, with autonomous-vehicle technology: Toyota has been more focused on creating an advanced driver-assist system, while Ford's self-driving effort seems to be aiming at the commercial-vehicle market.

A white Chevrolet Bolt EV with visible self-driving sensor hardware is shown outside the Design Dome on GM's historic Tech Center campus in Warren, Michigan.

The little Chevrolet Bolt EV, shown here in prototype self-driving form, is a key component of Barra's profit-growth plan. Image source: General Motors.

And FCA? FCA has a partnership with Alphabet's Waymo self-driving subsidiary; it built the vehicles for Waymo's current test fleet. But its electric-vehicle efforts seem rudimentary, and while it recently signed on as a partner in a self-driving development effort led by BMW, it's not currently known to have a significant self-driving research and development program of its own. 

The upshot: GM's winning hand for growth

Here's the key to the whole thing: Much of GM's profit today comes from the sale of SUVs (including crossovers) and trucks to customers in middle America. GM thinks that at least for a while, ride-hailing services using self-driving vehicles will be largely limited to cities, particularly (in the U.S.) the coastal cities where GM doesn't have a big market share. 

Translation: Profits from the new automated ride-hailing business will add to, rather than replace, GM's existing profit stream. It's the combination of GM's strength in trucks and SUVs with its emerging leadership in self-driving electric ride-hailing vehicles that puts it a step (or several steps) ahead of its key rivals.

John Rosevear owns shares of General Motors. The Motley Fool owns shares of and recommends Tesla. The Motley Fool has a disclosure policy.