The enemy of my enemy is my friend, even if they're also my enemy.

That must be the stance that Nokia (NOK 2.03%) is taking with Apple (AAPL -1.22%), even though the iPhone is largely responsible for Nokia's fall from grace over the past few years. Like other incumbents, Nokia underestimated the iPhone and saw unit shipments crater as a result, but let bygones be bygones. It's time to unite against a common enemy: Samsung.

Reinforcements
Amid Apple's global war with its South Korean frenemy, the iPhone maker was seeking a permanent injunction in the U.S. on 26 different Samsung products that were found to be guilty of patent infringement. In December, U.S. District Judge Lucy Koh denied this request since the company needed to prove that the infringing features were directly responsible for consumer demand of the guilty products.

Nokia has now filed a brief backing Apple's attempts to block various Samsung products, saying that Koh was in the wrong to deny the injunction. The Finnish smartphone maker is trying to stand up for broader patent protection rights, since it owns over 10,000 patent families. Even though Nokia isn't directly involved, it says its interest is to "advocate for patent laws" that aim to protect intellectual property while also fostering and encouraging innovation. The company has no position on any other issue within the case.

Who is the bigger threat?
While both Apple and Samsung have risen to become the top two smartphone vendors in the world, largely at the expense of Nokia, Samsung is a much bigger threat to Nokia. In the broader mobile phone market (including feature phones), Samsung famously dethroned Nokia as the top vendor last year -- a title that Nokia enjoyed for 14 years.

Here are IDC's estimates on total mobile phone shipments in 2012.

Mobile Phone Vendor

2011 Units

2011 Market Share

2012 Units

2012 Market Share

Samsung

330.9 million

19.3%

406 million

23.4%

Nokia

416.9 million

24.3%

335.6 million

19.3%

Apple

93.1 million

5.4%

135.9 million

7.8%

Source: IDC.

It's very much like Samsung and Nokia simply switched places in terms of both unit and market share. Within the smartphone subset of the mobile phone market, here's how things played out last year.

Smartphone Vendor

2011 Units

2011 Market Share

2012 Units

2012 Market Share

Samsung

94.2 million

19%

215.8 million

30.3%

Apple

93.1 million

18.8%

135.9 million

19.1%

Nokia

77.3 million

15.6%

35.1 million

4.9%

Source: IDC.

Nokia has long enjoyed success in lower end emerging markets with its low-cost devices, and right now Samsung is the bigger threat in those segments (until Apple releases an affordable iPhone), as the company targets every imaginable price point and form factor in a shotgun approach to product strategy. These markets are where Samsung is making most of its gains, since Apple still dominates the high end in developed economies.

Even a previous-generation iPhone was able to outsell the flagship Galaxy S III in the fourth quarter, with the newest iPhone 5 selling nearly twice as many units. Apple is now the top smartphone vendor in developed countries like the U.S. and Japan, while Samsung still has the lead in emerging markets like China and India.

Nokia's Asha lineup, launched last June, targets emerging markets and is seeing success, selling significantly more than the higher-end Lumias.

Product Family

Q3 2012

Q4 2012

Asha

6.5 million

9.3 million

Lumia

2.9 million

4.4 million

Source: Nokia.

At the Mobile World Congress last month, Nokia showed off a $20 feature phone that was of surprisingly respectable quality given the price point.

Grudge match
All of this shows why Nokia may still hold a grudge against Samsung, even as the company's turnaround is well under way and the transition to Microsoft (MSFT -1.27%) Windows Phone is starting to bear fruit. Nokia now comprises the overwhelming majority of Windows Phone shipments; Lumias were 73% of Windows Phone shipments last quarter. What's good for Nokia at this point is good for Microsoft, too, and a U.S. ban on Samsung devices would give Microkia some room to breathe.