After Amazon.com (NASDAQ:AMZN) nearly drove Best Buy (NYSE:BBY) to the brink of bankruptcy, the electronics superstore has battled back to the point where the two are not only able to coexist, but often even partner with one another.

So strong is their relationship today that Amazon and Best Buy just announced an exclusive deal that will have Best Buy selling Amazon Fire TVs in its stores while becoming a merchant on Amazon's site. Arguably, the very thing that nearly ruined Best Buy is now what's allowing it to grow.

Toshiba Amazon Fire TV Edition smart TV

Image source: Amazon.com.

Down but not out

Showrooming used to be a major problem for Best Buy. Customers would come into its stores to test out electronic gadgets then turn around and buy them online. So pervasive was the problem that five years ago nearly half of all electronics consumers bought online after having checked out the product in a store. TV sales were one of Best Buy's worst segments.

But the electronics retailer flipped the showrooming script on Amazon and other rivals by embracing it and offering to match online prices. It also created partnerships with tech giants like Microsoft, Samsung, Sony, and Alphabet's Google to create store-in-store boutiques that took advantage of the size and scale of its stores.

To a large extent, Best Buy has benefited from these alliances because other electronics retailers, including Circuit City, hhgregg, and even RadioShack, went bankrupt or shut down, meaning the tech companies had few alternatives available if they wanted to get closer to consumers. But Best Buy parlayed that advantage with the expertise offered through its Geek Squad service, which explains, installs, and repairs the gear and gadgets people are buying.

Apparently that's not been lost on Amazon.com, which has joined with Best Buy to sell its products over the years, including the early days when Kindles were the e-commerce site's best-sellers. It has since expanded the partnership to add other Amazon devices, including Fire tablets and TV sticks for streaming content, while more recently adding displays for Amazon's Alexa-enabled smart-home collection. While that can be akin to providing cover for the enemy, Best Buy used the opportunity to increase foot traffic and sales in its stores. Revenue was up 7% in 2017, with comparable-store sales 5.6% higher.

Smart TVs may be just the beginning

Now Amazon and Best Buy are taking their frenemy relationship to a new level. In the first part of the deal, Best Buy will begin selling over 10 different 4K and HD Fire TV Edition smart TVs from Toshiba and Best Buy's Insignia house brand beginning this summer. The new smart TVs come with Amazon's Fire TV built in and expand what you can do with a Fire TV stick. For example, you can watch live TV or stream content from Netflix, Prime Video, and HBO; detect devices connected to your TV; and use Alexa to search for content. At the same time, Best Buy will become a merchant on Amazon's website and get exclusive rights to sell Amazon Fire TVs.

Amazon may seem to benefit most from this arrangement, but because Best Buy is now a third-party merchant on Amazon and these Fire TVs are exclusive to Best Buy, customers who buy them on Amazon after testing them out in the store will end up being redirected to Best Buy. (Toshiba models will be available from Toshiba as well, however.)

Of course, there's no guarantee there will be heightened demand for Amazon smart TVs, so sales might not take off, but Best Buy will still be able to sell such sets from other manufacturers. Investors, though, were immediately concerned Roku would be odd player out with its own Roku-powered smart TVs that are sold at Best Buy, but there still may be sufficient demand for them as well.

Best Buy has expertly navigated the troubled waters Amazon.com created, and thanks to its Geek Squad may have even created a playing field that tips in its favor now. It's clear the e-commerce giant recognizes the electronics superstore as an equal, and both seem to be heeding the adage of keeping your friends close and your enemies closer. Frenemies may have to be kept closer still.