The fact that physical retail is hurting is old news. But the extent of its suffering became clear last week when news and research organization Reorg First Day reported that retail bankruptcies rose 110% in the first six months of this year compared with the same period a year ago. The consumer discretionary sector accounted for 24% of all bankruptcies this year, according to the ratings agency Fitch.

In its report, Reorg First Day released a chart listing major retailers that collapsed this year. True Religion, maker of jeans and shorts, started the slide at the beginning of this year by declaring liabilities of between $100 million and $600 million. Among the high-profile companies that declared bankruptcy this year was kids' retailer Gymboree, which declared liabilities of well over $1 billion. (See also: Gymboree Goes Bankrupt. Sears May Be Next.)

So what does this mean for the overall retail industry and for investors in particular? For starters, it means that online e-commerce is a trend that cannot be reversed and that Amazon.com, Inc. (AMZN) is poised to benefit from the trend. ZeroHedge, an online publication, has jokingly predicted that "every incremental retail bankruptcy should add approximately $5 billion to $10 billion to Amazon's market capitalization." (See also: 2017: The Year of Retail Bankruptcies.)

On a more serious note, the shuttering of offline retail destinations points to a consolidation of retail companies. Even as physical retail stores are shuttering, e-commerce startups are flourishing, as legacy players such as Wal-Mart Stores, Inc. (WMT) acquire them to boost their online credentials. Investors should put their money into legacy retail players with deep pockets that can weather the transition to online shopping.

The surge in bankruptcies also means that the retail industry will adopt the prevailing trends, which include artificial intelligence and robotics. Amazon has already ramped up the presence of robots in its warehouses. It is likely that shares of companies such as ABB Ltd. (ABB) that make industrial robots will witness an uptick as robots become more popular in retail warehouses. (See also: Amazon vs. Wal-Mart: Who Is Winning the Robot Wars?)

Want to learn how to invest?

Get a free 10 week email series that will teach you how to start investing.

Delivered twice a week, straight to your inbox.