It's easy to think that technology companies have a corner on the driverless-car market. After all, Tesla and Alphabet's Waymo attract most of the attention surrounding semi-autonomous and autonomous vehicles. Meanwhile, General Motors (NYSE:GM) has already built some of the earliest and most advanced versions of driverless cars on the roads.

This old automaker has been heavily investing in driverless cars over the past several years and has made huge headway so far. In fact, Navigant Research, a company that keeps track of who's leading the pack, consistently ranks GM as a driverless-car leader.

Why the driverless-car market matters to GM

In the coming years, autonomous vehicles (AVs) will create a massive opportunity for GM. IHS Markit predicts that in 2040 there will be 33 million driverless vehicles sold globally, which will represent 26% of all vehicles sold that year. Similarly, chipmaker NVIDIA -- which makes graphics processors for some driverless-car tech -- believes that in the coming decades all vehicles will have some level of driverless capabilities.

Intel believes this influx of AVs will create what it calls the "passenger economy," in which new businesses emerge around the driverless-car market; it says this new economy will be worth $7 trillion by 2050.

Whether we'll all have food delivered to our cars or get our hair cut while traveling to work is up for debate. But new markets are already coming into focus. Ride-hailing, for example, is expected to reach $285 billion by 2030, and could see far more growth as driverless cars hit the streets just a few years afterward.

Why GM might just win this race

GM understands that if the driverless vehicle market becomes as big as many project, then it could shift consumers' buying habits away from owning a vehicle and toward sharing, partial ownership, subscription services, and ride-hailing.

To get out ahead of these trends, the company purchased the self-driving-technology start-up Cruise Automation in 2016. GM has begun adding Cruise's semi-autonomous technology into some of its vehicles, and says it will release its fully autonomous Cruise AV -- without a steering wheel or pedals -- to the roads next year.

Other automakers and tech companies are also making headway in this market, but GM's advantage could be in its manufacturing. Anyone who's been following Tesla's growth story knows that vehicle production isn't an easy business. But GM's experience and its vast manufacturing capabilities have already allowed it to build 130 mass-produced autonomous vehicles last year -- an industry first.

GM made changes to one of its assembly plants in Michigan so the AVs could be outfitted with the proper driverless-car technology. By being the first automaker to mass-produce AVs, GM has shown that it knows how to pair its manufacturing know-how with cutting-edge driverless-car tech to outpace its competitors.

The automaker still doesn't earn any revenue from driverless cars -- hardly any company does right now. But GM could be able to use its AV fleet for ride-hailing services in the near future. The company just received a massive $2.25 billion investment from Softbank Vision Fund to help launch its driverless cars, which comes on top of GM's own $1.1 billion it's pledged to spend. The seven-year agreement will help launch GM's driverless cars next year; it provides plenty of cash to help Cruise Automation continue to build market-leading autonomous-vehicle technologies.

Exactly how GM will make money from driverless tech hasn't been nailed down just yet. However, it owns a car-sharing company called Maven that would be a great fit; GM could provide it AVs for ride-hailing services. Similarly, GM owns a stake in Lyft, and could deploy some of its Cruise AVs for that service as well.

The takeaway for investors here: GM is already mass-producing driverless cars from its plants; it has its own driverless-tech company, which just received a massive cash infusion; and it has the partnerships in place to start using its AVs for ride-hailing. If there was ever an automaker that's poised to win the driverless-car race, it's GM.