Android isn't a competitor to the iPhone, because Google does not sell Android operating systems. Google sells services and ads, and the way to ensure that as many people as possible have access to them is by developing Android and putting them on every non-Android device with significant enough marketshare.
They make money if you use their services on an Android device; they make money if you use them on an iPhone.
It would be a nice bonus if Android ran all other smartphones out of the market, because having control of the market leader makes it easier to guarantee that everyone has access to their services, but that is not their aim.