A Samsung store in the Meatpacking District of Manhattan, New York, Oct. 10, 2016. Reuters/Andrew Kelly

Samsung and Apple have been rivals ever since they debuted their first devices, a decade ago. Over the years, they have sued each other but also worked with each other — Samsung has supplied the hardware for many Apple iPhones over the years.

Both companies have had a strong 2017 — Apple has become the most valuable tech firm and expected to become a trillion dollar company soon, while Samsung has not just recovered from the 2016 Note 7 crisis, it has sold millions of Galaxy S8 handsets and more importantly, set up its chipset business. Samsung is expected to become the world’s biggest chipset manufacturer, surpassing Intel, which has ruled the industry for decades.

Apple is riding a strong wave due to the demand for its iPhones. It has also become the lone player still standing strong in the tablet market with its iPad, having sold more than a billion iPhones till date.

Read: Apple Q1 2017 Earnings Report: Apple Beats Estimates, Returns To Growth In iPhone Sales

The company reported its first revenue decline last year, but bounced back with two consecutive strong quarters. iPhone 7, launched last September, also sold large numbers and led to a 4.6 percent increase in total revenue for the fiscal year 2016 to $52.90 billion. Profit in the first quarter of the fiscal year 2017 rose 4.9 percent year-on-year to $11.09 billion.

Apple announced on April 30 that its cash reserves crossed $256 billion, which is a milestone for any company that does not work in the finance sector. The company is set to launch its most awaited device till date, the iPhone 8. It is expected to feature an edge-to-edge display, wireless charging, a 10-nanometer processor and augmented reality based features.

The anticipation of the device is so high that it has started to hurt the sales of the existing iPhone. “We’re seeing what we believe to be a pause in purchases on iPhone, which we believe are due to the earlier and much more frequent reports about future iPhones,” Apple CEO Tim Cook stated in an interview earlier this year.

Besides the iPhone, Apple’s MacBooks have also become a bright spot on the company’s balance sheet. The company’s new MacBooks with Touch Bar sales showed a 14 percent increase to $5.84 billion.

The company has also been benefiting from its services business – its app store, music and payment services have risen from $6 billion the previous year to more than $7 billion this year.

Samsung, on the other hand has had a roller coaster of a ride recently. In Q3 2016, it lost $2.19 trillion won ($1.93 billion) in revenues year-on-year. The company then bounced back with two successive strong quarters — it posted a 9.22 trillion won ($7.9 billion) operating profit in Q4 2016 — 50 percent higher year-on-year and highest in three years and in Q1 2017, the company posted an operating profit of 9.9 trillion won ($8.7 billion).

Unlike Apple, Samsung has adopted a different approach. While Apple has gone from strength to strength due to shareholder confidence and sales of its devices, Samsung has chosen to diversify its business and go into the chipset business. The company already manufactured displays and batteries, but its investment in chipsets is what is driving its growth.

According to investment advisor Matt Bohlson, semiconductor demand is expected to strongly accelerate right up to 2020 due to increased demand because of internet-of-things, cloud data centers, smart and autonomous vehicles. Semiconductor sales made up 63 percent of the company’s profit in Q1 2017.

According to Samsung’s earnings guidance, it is expected to post its highest ever profit in Q2 2017 — $12.1 billion. This would mean it might cross Apple’s operating profit, which is pegged at $10.55 billion by analysts.

While Apple continues its strong run, Samsung is slowly but steadily edging its way into the mobile business in more ways than one. It has been developing technologies and mobile components. With the Samsung Galaxy S8, the company has demonstrated its capabilities to develop and mass-produce new technologies such as an edge-to-edge display and a 10nm processor.

Read: Samsung Replacing Intel, Qualcomm As Top Chipmaker, Taking Lead In Other Smartphone Components As Well

Samsung is predicted to remain on a growth spiral for long since the demand for its mobile components is expected to peak at least till 2020. Continued growth will help the company, whose market cap currently stands at $200 billion to develop its smartphone technology and provide Apple with tough competition.

Samsung’s change in strategy from producing components for just its own devices to going into mass production of such components is expected to benefit the company in the long run and might even put it ahead of Apple in terms of device offerings.

While Apple currently reigns over the smartphone market, Samsung is edging its way upwards and holds a lot of promise for the near future.