But even though Apple may win by getting a 5G iPhone to customers sooner than most people anticipated, it lost by settling with a company it loathes. Getting the iPhone to 5G means Apple was put in a sticky situation where it had to weigh four less-than-ideal options to make it all a reality.

Its surprise settlement with Qualcomm on Tuesday over a yearslong patent spat means it's now in a position to keep pace with its competitors to bring a 5G-ready iPhone to market as soon as this year.

In the end, Apple had to choose the lesser of all evils:

Option one: Settle with Qualcomm, the leader in 5G chips. Qualcomm's 5G chips are already shipping in some devices today, with more expected as the year rolls on.

But Apple has seen Qualcomm's business model as detrimental to the entire industry since it uses its dominant position to squeeze large fees out of each company that uses its chips and patents. Hence that nasty lawsuit. Apple CEO Tim Cook made his disdain for Qualcomm's practices known in a January interview with CNBC's Jim Cramer, and even blasted Qualcomm's decision to hire a PR firm to write fake news stories about Apple, which Business Insider reported.

Option two: Wait for Intel to catch up in 5G. Even before Intel announced Tuesday night that it would abandon its plans to make 5G modems, there was speculation that the company was running behind to deliver the chips on time. Apple has been exclusively using Intel's 4G modems in its latest iPhones as its dispute with Qualcomm raged on. If that dispute continued, a 5G iPhone might not have been possible until 2020 or even 2021.

Option three: Choose Huawei. In an interview that ran on CNBC this week, Huawei's CEO said the company was "open" to talks with Apple about bringing its 5G chips to the iPhone. But a partnership with Huawei would've looked bad for Apple, given the stink of political and security concerns around the company. (Huawei's CEO has denied spying allegations.)

Option four: Apple could make its own 5G chips. Apple is thought to be working on its own modems after opening an office in San Diego, Qualcomm's hometown, and posting job listings for modem chip designers. But it would likely take Apple several years to develop its own 5G chip, putting it several years behind its rivals.

None of those options were ideal for Apple. It could've waited an extra year or two for Intel to get its 5G chips up to snuff. It could've waited several more years to develop a 5G chip of its own as competitors like Google and Samsung push out their 5G devices and market themselves as more innovative than Apple. It could've worked with Huawei, a company that still can't sell products in the U.S. over security concerns.

Or it could've ended its dispute with Qualcomm, even if Cook is allergic to its business practices. Unfortunately for Apple, Qualcomm was the best bet.

Tuesday's settlement could result in a 5G iPhone as soon as this fall, when Apple is expected to release its next iPhone. (For what it's worth, timing on a 5G iPhone is still unclear. Qualcomm CEO Steve Mollenkopf said in an interview Wednesday on CNBC's "Squawk Box" that he couldn't comment on Apple's product plans that include Qualcomm chips.)

Qualcomm gets to take a victory lap this week. Its lead in 5G forced a settlement with Apple and added a massive boost to its stock. Qualcomm shares was up 12% Wednesday, adding to its 23% gain Tuesday. Intel was up about 4%. Apple was up just 1%.

The market agrees. Apple was the loser in this fight.