With brick and mortar stores shuttering at a record pace, retail in the U.S. feels like it’s at a tipping point. Many of the stores that once filled the malls of America have become “zombies,” while online retailers capture ever more of the most valuable consumers — the young and affluent.

Legacy retailers are trying to play catch-up, but they’re saddled by huge fixed costs, investors who prefer dividends to innovations, and CEOs incentivized to focus on the next quarter, not the next decade. It’s only a matter of time before Amazon.com’s army of physical retail formats turn into an existential threat to everyone from Mom and Pop to Kroger and Wal-Mart.

That doesn’t mean retailers are taking this lying down. As online brands begin to build physical shops, the old guard is taking notes — and in many cases, writing checks. Wal-Mart, for example, has been on an acquisition binge of late. It’s now in talks to buy men’s clothier Bonobos for $300 million.

After surveying analysts and CEOs, I learned the three biggest lessons physical retailers are grappling with as they face this rocky transition.

Data is King

When I asked Target, Walgreens and grocery chain Giant Food about loyalty programs and the fate of customers’ purchasing data — which is the in-store equivalent of your web browsing history — they all declined to comment. Why so cagey? Perhaps because of the uproar that occurred when Target sent coupons for baby clothes and cribs to the home of a teenage girl, alerting her family she was pregnant, says Michelle Evans, an analyst at consumer research firm Euromonitor.

Data has been a vital part of Amazon’s retail revolution, just as it was with Netflix’s media revolution and Google and Facebook’s advertising revolution. For brick-and-mortar retailers, purchasing data doesn’t just help them compete with online adversaries; it has also become an alternate revenue source when profit margins are razor thin. For example, Unilever might buy store sales data to figure out which products are in high demand and when people buy them. (Ms. Evans says that when retailers sell data, it’s anonymized and not linked to individual consumers.)

Physical retailers must catch up to online retailers in collecting rich data without making it feel so intrusive. Why, exactly, does my grocery store need my phone number?

Personalization + Automation = Profits

There’s a debate in the auto industry: Can Tesla get good at making cars faster than Ford, General Motors and Toyota can get good at making self-driving electric vehicles? The same applies to retail: Can physical retailers build intimate digital relationships with their customers — and use that…