Apple phones have software which is created by Apple, So, they can rollout software updates to each customer directly.
With the exception of Google Nexus and Pixel, Android phones don't contain purely Google's Software. Each individual phone contains a modified version of the OS, which has been customized by the hardware manufacturers.
So in a Nut-shell,
Apple > iPhone
Google release an OS Update > Manufacturers think about how to customize it > They naturally provide the customers two major OS updates > approx 5% flagship users get update.
So, we mid range user don't get any major OS update after two OS update. Besides these all reasons there is a Marketing strategy, that is Cell provider managers think, hey, if we don't update the OS, customers will just have to buy a new phone!
● if there are any other issues please reply that...
The biggest benefit is that users of Apple's products get software updates pretty early and for quite a many years.
Unfortunately, users of smartphones using Android software, like Samsung, will get software updates a maximum two times. This is not restricted to just mid range users; it's across the entire spectrum of Samsung's portfolio of smartphones.
For example, S9 series smartphones were released in 2018 with Oreo, will get the Pie update in 2019 and finally Android Q in 2020. In 2021? Nothing! No Android R!
So now, the technological savvy and security conscious person will want to buy a new smartphone. Those with deep pockets buy a new smartphone every year, when a new model is available.
If I'm not mistaken, even Goggle releases only two major updates to its range of smartphones.
As the OP has correctly stated, manufacturers want people to buy their new products.