Source: Tesla Motors, Inc .

Apple (AAPL 0.01%) isn't in competition with Tesla Motors, (TSLA 3.23%), but Tesla could be Samsung's new worst enemy if its proposed Gigafactory goes as planned. It's a tangled love-hate triangle and someone's bound to get hurt. Here's what investors need to know.

More than an automaker
When Apple unveiled the iPhone in 2007, it forever changed the way we interact with technology. But, when Tesla Motors opens the doors to its Gigafactory in 2017, it will forever change our ability to energize and sustain technology itself.

Tesla Motors is making more than a battery manufacturing plant. The $5 billion dream is quickly becoming a reality, and its ripple effects have the potential to shock more than the automotive sector. Through its partnership with Panasonic, the third-largest lithium-ion battery maker in the world, the electric-car maker expects its battery pack's per kilowatt hour cost to drop an incredible 30%.

You might not think that a Tesla vehicle's much larger battery array has much in common with your smartphone's puny power source, but Tesla's energy storage system has something for everyone. The automaker rejected conventional thinking behind building one big battery, and instead packs each car with as many as 7,000 standard lithium-ion cells. If you're reading this article on your laptop, a handful of the same cells are powering your device right now.

Not only is battery cost-cutting good news for the Tesla Motors assembly line, but it also presents a tremendous threat to Samsung, currently the world's largest lithium-ion battery producer and Apple's main competitor.

Source: Tesla Motors; "SDI" is a Samsung business.

Apple has been taking its own steps to cut out Samsung's battery business since 2012, when it severed ties with Samsung as one of its battery providers (and processor designers). In the past few years, Apple has continually swapped around suppliers, and is reportedly hedging its bets by bringing on two separate suppliers for its newest iPhone line.

The Apple advantage
If all goes as planned, Apple will have Tesla Motors to thank for two reasons. First, a drop in battery pack costs is good news in and of itself. The iPhone maker's fat margins have seen some trimming as competition picks up, but the so-called commoditization of smartphones could actually help Apple. 

With the most powerful brand around, cheaper production costs mean Apple can keep its top-line relatively elevated, while enjoying the same lower costs as all its competitors. According to HIS Technology, battery costs clocked in at $5 for each iPhone 5, a sizable 2.2% of the estimated $230 in total manufacturing costs. If Apple can trim that fat while keeping phone prices elevated, it'll be another margin win over lesser-branded Samsung.

Second, if Tesla Motors' Gigafactory performs as expected, it'll take a bite out of Samsung's overall sales and internal symbiosis. As renewable energy ramps up demand for energy storage, Samsung batteries could be pushed offstage as Tesla and Panasonic scale up operations to take the spotlight. Not only will that hurt the larger corporation, but it'll also mean Samsung outsourcing its battery production to Tesla and Panasonic (or its offshoots) if it wants to keep costs competitive with Apple.

Samsung has recognized Tesla's threat, and took the offensive this month by merging Cheil Industries, its materials business subsidiary, with Samsung SDI, its battery subsidiary. The newly formed company is meant to scale up and strengthen its battery business, and has set itself a goal of reaching $26 billion in annual sales by 2020 -- that's equal to around 13% of Samsung's current total annual revenues.

But scale alone might not bring Samsung the cheaper and better batteries it wants. Tesla Motors Founder and CEO Elon Musk estimates that a full one-third of cost reductions come directly from technological improvements alone -- something Samsung can't directly replicate.

Sector swapping
It's increasingly difficult to separate corporations by sectors, and this latest battery-powered overlap could be the largest disruptor either the automotive or telecom sector has seen in a long time. If the Gigafactory lives up to expectations, there'll be more reason than ever before to believe that Apple can hold its own against Samsung.