Over here (Uruguay), it's the network effect, and Android being cheaper (both perceived and in app availability).
Apple makes no efforts to cater to some particulars of Third World countries (like, no credit card even having enough income, and a strong dislike to tying it to anything). I wonder how they manage to be apparently strong in China. Android dominates in Africa, Latin America, and the Middle East
App availability is much better for Android here.
Microsoft made many of Apple's screw-ups as well.
So, if you plan to buy a high end phone in Uruguay, 97% will end up buying an Android (and most of those will end up with a Samsung Galaxy, which is what the official carrier pushes).
Apple does have a lot of signalling value though :) and and iPhone is perceived as a luxury product too, but it's way more impractical here.