THE whizzy gadgets for geeks to goggle at during CES, an annual consumer-electronics show in Las Vegas, have typically been small enough to pick up. But they have been joined in recent years by an increasing number of cars. The Detroit motor show, America’s biggest and glitziest, starts later this month, but many in the car industry now regard CES, which opened on January 5th, as a more important event. Mary Barra, GM’s boss, unveiled a new production version of its Bolt electric car at Las Vegas this week.

Incumbent manufacturers are recognising the double threat posed by technology, as car-sharing takes off and driverless vehicles come closer. First, some people who might hitherto have wanted to own a car may no longer do so, cancelling out the growth the motor industry might otherwise have expected from the rising middle classes in developing countries (see chart). Second, technology firms may be better placed than carmakers to develop and profit from the software that will underpin both automated driving and vehicle-sharing. Some of these firms may even manufacture cars of their own.

In a report ahead of the Las Vegas and Detroit shows, Morgan Stanley, an investment bank, said the motor industry was being disrupted “far sooner, faster and more powerfully than one might expect.” It predicted that conventional carmakers would scramble in the coming year to reinvent themselves. As if to demonstrate this, shortly before CES opened, GM announced a $500m investment in Lyft, a ride-sharing service.

A rumoured tie-up between Ford and Google to produce driverless cars failed to materialise at the show, but even the rumours underlined the disruption that tech firms are bringing to the motor industry. And other partnerships were announced: Ford is teaming up with Amazon to connect its cars to sensor-laden smart homes. It was also revealed at CES that Toyota would adopt Ford’s in-car technology, which is a competitor to Apple’s CarPlay and Google’s Android Auto, to access smartphone apps and other features.

That is not the only example of carmakers joining forces to avoid being beholden to the tech giants. In August BMW, Daimler and Volkswagen’s Audi division jointly bought Here, a mapping service, from Nokia, to ensure that carmakers have an independent provider rather than having to depend on Google Maps. Nevertheless, carmakers are also teaming up with tech firms because each has something the other needs. Building and marketing cars, and dealing with safety and emissions regulators, is tricky. Tech firms could copy Tesla, which has built its own electric cars for more than a decade. Apple, which is said to be planning an electric car, may try to have them made in the same way as it does its iPhones, outsourcing to a contract manufacturer. But a more obvious route is to ally with an established carmaker.

Carmakers also have lots to learn. Most are working on making their vehicles either fully or partly self-piloting, and a number are running their own car-sharing experiments. But Google remains the leading exponent of autonomous driving. Its robotics, drones and search engine all contribute expertise that helps to guide a driverless car down the road avoiding pedestrians, obstacles and other vehicles, using computing power and sophisticated software to interpret masses of data received both from the car’s on-board sensors and from external sources through wireless connections.

Yet if the tech firms have much to gain as they muscle in to the motor business, the carmakers are wary of what they have to lose. Profits may seep away towards the producers of the software and the owners of the data, and away from the makers of the hardware. Hitherto, new cars—even quite modest ones—have tended to be bought as status symbols and expressions of personal style, but if consumers become more interested in what software and entertainment systems a car can run, rather than what it looks like, the industry’s whole business model may come apart.

Ride-sharing, car clubs and other alternatives to ownership are already growing fast. Young city-dwellers are turning their backs on owning a costly asset that sits largely unused and loses value the moment it is first driven. Carmakers insist that such consumers are merely deferring buying a vehicle, pointing to the fact that people continue to drive at an older age than they used to. But the pronouncements of motor-industry bosses suggest that doubts are creeping in. At CES Mark Fields, Ford’s CEO, said that it would in future be “both a product and mobility company”.

Membership of car clubs, which let people book by app for periods as short as 15 minutes, is growing by over 30% a year, according to Alix Partners, a consulting firm, and should hit 26m members worldwide by 2020. Competition is intense. ZipCar, owned by Avis Budget, a conventional car-hire firm, is thriving. More carmakers are copying Daimler’s Car2Go and BMW’s Drive Now apps. Earlier this year Ford began testing both a car-sharing service in America and a car club in Britain. Daimler reckons its scheme is profitable. But such services are unlikely ever to match the returns, especially for premium makers, from selling vehicles.

At the same time, app-based taxi services such as Uber and its Chinese counterpart Didi Dache, which are often cheaper and more efficient than conventional cabs, are also growing quickly. Once these are able to dispense with drivers for their vehicles, the taxi, car-club and car-sharing businesses will in effect merge into one big, convenient and affordable alternative to owning a car.

So when will the fully autonomous car hit the showrooms? Google, whose cars have done 1.3m test miles (2.1m km) on public roads, once promised 2018, whereas most analysts reckoned the 2030s more plausible as carmakers introduced automated-driving features in stages. Now, Mr Fields is talking about autonomous cars being ready to roll by 2020. More conservative car bosses add five years.

Barclays, another bank, forecasts that the fully driverless vehicle will result in the average American household cutting its car ownership from 2.1 vehicles now to 1.2 by 2040. A self-piloting car may drop off a family’s breadwinner at work, then scuttle back to pick up the kids and take them to school. The 11m or so annual sales of mass-market cars for personal ownership in America may be replaced by 3.8m sales of self-driving cars, either personally owned or part of taxi fleets, Barclays thinks.

Driverless cars still have problems in bad weather. They may struggle to recognise that light shining off a puddle is harmless or guess that a pedestrian is about to step into the traffic without looking. But sophisticated systems for hands-free driving on motorways, and for automated parking, are already available on a number of manufacturers’ models. Fully driverless cars will ferry workers round GM’s technical centre in Detroit in late 2016.

Convincing regulators to allow fully driverless cars onto the streets is the next hurdle. Insurers and consumers also need to be won round. If self-driving cars can be introduced first on private roads or designated areas of cities to prove their worth in avoiding accidents and reducing congestion, that might help. Within the industry, the big question is not whether this future will arrive, but whether tech firms or carmakers will grab the spoils. Will the sign on the dashboard say Ford (powered by Google) or Google (powered by Ford)?