Android has more ads if you buy it through a carrier, but you can easily make it have far fewer ads by installing LineageOS, and then installing Firefox with the real uBlock origin (not ublock origin lite).
iOS does not allow you to install alternative browsers, nor can you customize the OS to the level of lineageOS, so iOS simply cannot match the best that you can do on android.
Android has more of a free market because on my pixel phone, I can choose either Google's android distribution, or LineageOS, or Graphene, or build my own ROM. I can use F-Droid or the google play store.
What we need is laws requiring that all iDevices apple makes are open hardware which support installing android, iOS, or a custom OS you build yourself, all hardware-essential drivers are free, and so on. That would let people compete on the software side of thing while Apple's hardware team iterates on that. If iOS really is better on its merits, people would install it even with the option to pick other OSs.