What happened

Lithium stocks were on fire in 2017, with Sociedad Quimica y Minera de Chile (NYSE:SQM), or SQM, leading the pack with stunning 107.2% gains.

If you've watched the astronomical rise in lithium prices in the past couple of years, you'd think SQM is the world's leading lithium manufacturer, going by the jaw-dropping run-up in its stock price. That's not the case: Albemarle (NYSE:ALB) is a larger lithium player, having generated $946 million in sales from lithium and advanced materials during the nine months ended Sept. 30, 2017, compared with SQM's $465.2 million sales from lithium and derivatives during the period.

You guessed it right: There was more to SQM stock's 2017 rally than just lithium prices.

So what

SQM shares kept heading north last year before peaking in mid-September. Solid earnings growth, a potential stake sale, and the world's -- especially China's -- growing appetite for electric vehicles were just some of the factors that drove SQM shares through the roof.

SQM's net income zoomed 61% during the nine  months ended Sept. 30 despite a smaller 14% growth in revenue, thanks to lithium. Lithium's share in SQM's total revenue jumped to 29% from 24% in the year-ago period, as sales volumes and prices surged. Most importantly, lithium accounted for 61% SQM's total gross profit during the nine-month period, which explains the jump in its bottom line. Sensing tremendous opportunities ahead, management is now scaling up its lithium projects at a rapid pace.

A hybrid electric car charging its battery.

Lithium's key application is in lithium-ion batteries used to power electric vehicles. Image source: Getty Images.

Meanwhile, there were rumors that a Chinese private equity firm, GSR Capital, was eyeing a major stake in SQM. It soon became clear, though, that they weren't just rumors when other Chinese companies joined the quest. Two factors were driving interest in SQM: China's rise to the top in the global EV market, and Potash Corporation's proposed 32% stake sale in SQM. (PotashCorp is now known as Nutrien, following its recent merger with Agrium.) SQM is also a potash manufacturer. In fact, mining giant Rio Tinto was also in the race for SQM and pulled out just days ago.

As if lithium's allure and China's interest in SQM weren't enough, presidential elections in Chile, where the company is domiciled, added fuel to the fire. Sebastian Pinera's election as the president of Chile in December sent SQM shares soaring again, so much so that it recouped all of its losses from the previous three months to end the year with triple-digit gains.

Now what

SQM's shares may seem pricey, but the company has its plans in place to ride the lithium wave. Its lithium production capacity is expected to rise significantly this year, even as it prepares to start up another project in Argentina in 2019 to boost production further.

That aside, a stake sale that's still in the works and hopes that Pinera would bring Chile back on the growth track could be some other positive triggers for the stock that peers like Albemarle don't enjoy.

Neha Chamaria has no position in any of the stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.