Well, yeah, you do have a point of many different phones which run Android and manufacturers sometimes have their own brew of Android so devs can't optimize for a limited amount of possible hardware. That said, when the least expensive current phone (iPhone SE 2022) for a certain OS costs a cool ~500 Euros, the manufacturer claims 30% of app prices for themselves and there aren't many alternative app stores you can put a whole different manpower behind the development and support of the OS to squeeze out the maximum amount of performance and user experience.
Many people don't have that kind of money and don't want to get subsidized plans from their provider as well, that's when Android comes in, you can get very decent phones for not even half the price of the least expensive iPhone.
That said, I really don't get resolutions such as 4k on phones, I mean my current Moto G7 Play has a resolution of 1512x720 (5.7" screen) and I can't imagine doubling, quadrupling or even more the resolution will result in a much sharper image. I mean, my current PC monitor has 1920x1200 on 24" and I really don't know why you would want four times the pixel count other than "l00k, I have 4k". Even 1080p movies are very crisp, upping the resolution just takes more space and (for me) doesn't do a whole lot of image improvement.