The Internet of things, the term used to describe the use of sensors and other Internet-connected devices to track and control physical objects, opens up entirely new ways of doing business. It’s now possible to track individual components and products as they travel on ships, planes, or trucks. Sensors can weigh all of the parts in an inventory bin in a factory or all of the sweaters in a store’s stockroom, enabling new levels of supply-chain efficiency and inventory management.

With “IoT” sensors, as they’re called, on equipment companies can monitor machine performance continuously and schedule maintenance only when it’s needed—or predict when there is danger of a breakdown. The application of this technology can reduce maintenance costs by up to 25%, cut unplanned outages by up to 50%, and extend the lives of machines by years.

The Internet of things can also give rise to new business models that could alter the basis of competition. Products that report how they are actually being used can provide much better insight into customer behavior than focus groups. Connected products can even adapt to their customers’ preferences. And the ability to offer almost anything—from a drill press to a car to an aircraft engine—as a service can transform the very nature of what is bought and sold.

In our research for the McKinsey Global Institute, we looked at more than 150 specific IoT applications that exist today or could be in widespread use within 10 years and estimate that they could have a total economic impact of $3.9 trillion to $11.1 trillion per year in 2025. We also found that more than two-thirds of value will be generated in business-to-business settings and that business customers and consumers will likely capture more than 90% of the value created.

To capture this value, however, businesses need to overcome three significant obstacles: They need to push technology vendors to provide connected, interoperable components and systems, with analytics; they must address security and privacy concerns; and most importantly, they must make organizational changes to maximize the operating and strategic benefits that IoT data can provide. Here’s a look at these obstacles in detail.

Connected, interoperable systems (with analytics)

Companies need to deploy connected systems that are interoperable with one another and with other information systems. We estimate that interoperability is required for 40% of the potential value that the Internet of things can provide. In addition to connecting interoperable devices, companies must integrate and customize the analytical software that can derive business insight, e.g. prediction and optimization, from real-time streams of data from sensors. For example, many of the components on a modern oil platform are now connected; there are over 30,000 sensors on such a platform. But less than 1 percent of the data generated by these sensors are currently used for decision-making. And a majority of the predictable maintenance issues require data from multiple components to be combined and analyzed.

Privacy and security

One of the biggest challenges for companies that hope to capitalize on the Internet of things is protecting company and customer data. A range of IoT-based applications depend on access to consumer data, including data collected passively from customers’ behavior. For example, one use of the technology could be fully automated checkout in retail settings. Customers could literally walk out the door of a store without having to wait on line or even swipe a card: Data-gathering “beacons” can scan tags on all the items in a shopping cart, total the bill, and debit the customer’s account, perhaps even deducting mobile money from the customer’s smartphone. We estimate that automated checkout could be worth as much as $380 billion per year in reduced costs for retailers around the world in 2025.

Other applications depend on tracking consumers by following their smartphones—to offer discounts based on what aisle the shopper is in, for example. But implementing these applications will require building trust with consumers, ensuring that data will only be used in certain ways and will not fall into the wrong hands. This is a significant challenge given the many well-publicized data breaches in recent years. Companies will need to work with technology vendors and invest in data-security capabilities. Companies will also need to build protections for their own data and intellectual property when they implement IoT systems. Every sensor is a potential entry point for hackers and the consequences of a breach can be enormous. What if a hacker seizes control of all the machines on a factory floor?

Creating the right organization

Even the largest, most sophisticated corporations struggle to make the most of information technologies. The Internet of things only adds to the challenge. The most important benefits of IoT investments—both strategically and operationally—stem from the ability to capture, analyze, and act on the data that can be collected. This requires not only sophisticated technology, but also an organization that can share data and management that is ready to make data-driven decisions. IT experts will need to become more deeply embedded in operations as processes are redesigned around IoT and managers at every level will need to learn how to interpret real-time data (i.e., the integration of information technology and operations technology). Owners of data—the chief information officer, chief financial officer, chief marketing officer, and chief operating officer—will need to share their data. Most importantly, top executives will need to learn to rely on machines to make some real-time decisions (where to allocate store staff or when to slow down an assembly line, for example) and to harness data for their own decision making.

Companies have a great deal to gain from the Internet of things. The business leaders who tackle the obstacles to implementing these systems and invest in new capabilities early stand to gain the most from building competitive advantages.

James Manyika is director of the McKinsey Global Institute, where Michael Chui is a partner.

Sign up for Data Sheet, Fortune’s daily newsletter about the business of technology.