The iPhone rarely was the top selling phone and never had the majority of the market (though it was of course a single company against 4-5 other companies anyway).
It was the phone that caught most of the top end (pricy) market and almost all of the profits, and it remains that.
That said, not sure what's this "isn't the top selling phone any more" is supposed to mean. The headphone-jack-less iPhone X killed it in the market:
https://www.cnet.com/news/iphone-x-was-best-selling-smartpho...
That report was the moment I knew Apple had lost their position as the leader in the market, because they had to take specific dates in time to say they were best-selling...as opposed to a few years ago, when they were best selling all year long in a runaway.
Besides, not even sure what you're going about. Apple never sold the most phones.
If anything it's the opposite: they're catching up to Samsung:
https://www.statista.com/chart/7941/apple-vs-samsung-smartph...