Android vs. Android
Back in the year 2003 when Android, Inc. was co-founded by Andy Rubin (with Rich Miner, Nick Sears and Chris White), which was later acquired by Google in 2005, Google formed the Open Handset Alliance together with device manufacturers like Samsung, HTC and Sony and carriers & chipset makers like Sprint, T-Mobile, Qualcomm and Taxes Instruments. The goal was simple, to create an open set of standards for mobile that any device manufacturer can adopt. Android was the first product that OHA announced; a mobile operating system based on Linux. Later, Google would take care of the platform's core development (while keeping the project open source, receiving numourous contributions from community), and would back it with the services it provided, and thus, first phone running Android came out in 2008, the HTC Dream.
The phone was bare-bones, provided very basic set of smartphone features (in comparision with today's smartphones), but it had Google's services like; Search, Gmail, Maps, Earth, etc. built right into it. Though it was a first Android device, launched right after Steve Jobs unveild iPhone, Apple was not the only enemy that Google made along its way to going mobile (although first generations of Apple devices relied heavily on Google's services). There was a lot coming later.
In a few years of Android's launch, it became a behemoth, thanks to Samsung & HTC's push into smartphones. Versions after versions released, Android kept on getting better and better; Nexus line of devices launched by Google collaborating with partners like HTC, Samsung, LG, Asus and Motorola. But one thing was shrinking with every coming release, the true idea of openness that Open Handset Alliance started out with. Google was taking back the control of Android.
In the year 2012, with the release of Android 4.2, Google Play Services (also sometimes referred as GMS, Google Mobile Services) was introduced as a part of the platform. Technically, Google Play Services was intended to decouple some of the core applications and services from the Operating System itself, which can then be updated via Google Play Store (formerly called Android Market). Also, it became home for all the Google Services which are part of Android but are NOT open source; i.e. Gmail, Maps, Drive, Search, etc.
While GMS started out with good technical intentions, i.e. to deliver critical security fixes and important updates to core Apps of Android without having to flash new Android version into the device. As the Android releases went by, more and more stock Apps were released seperately in Google Play Store (thus becoming a part of GMS, directly or indirectly), eg; Google Keyboard, Messenger (an SMS/MMS app), Google Camera, Google Calendar and many other background services which were originally a part of AOSP (Android Open Source Project, is what we call non-Google'ified Android).
It is worth noting that these are all basic apps that any smartphone operating system would provide out-of-the-box, and Android being an Open Source project, oughts to provide these as a part of source code itself, which is not the case here. Also, Google Chrome, the company's popular desktop web browser, is made available for Android starting with version 4.1 (Jelly Bean), although Android had its stock web browser intact until version 4.3, but with Android 4.4 Kitkat, stock browser is removed and Google Chrome is made default (thus, axing another AOSP component with a proprietary one). Same thing happened with stock Camera app, as Google Camera is made default, Messaging (stock SMS/MMS) app got replaced by Messenger, Google Calendar replaced the stock Calendar app and Gmail replaced the Android's built-in Mail client (as Gmail now supports adding other accounts, including Microsoft Exchange and Outlook).
The Ugly Skin
As AOSP thrived inspite its odds, OEMs have their on takes on how Android should be like in their devices. While first Android releases were not very polished to say the least, OEMs did an impressive job to re-skin them such that end users don't feel bizzare in using it. And as tough as it is for an Android fan to digest, the main competitor iOS was years ahead of Android in terms of aesthetics and usability. Samsung calls its skin TouchWiz, HTC calls it Sense and Sony calls it Xperia Sirius (Xperia being also a name for their smartphone series). While in the initial years, these skins helped Android greatly in expanding its reach, as with stock experience, Android would not have been adopted as widely. But with Android 4.0, Google started to focus more on Android design, and that's when OEM skins started to feel ugly. The problem worsened when OEMs abused their rights to customize Android by putting bloatware on it.
Starting with Android 4.0, each successive release made significant improvements in design and usability, while OEMs continued to made their own versions of Android more resource intensive and full of unnecessary apps. Android 5.0 Lollipop came out and Google showed its design abilities which put all third-party Android skins to shame. Moreover, Android now had all the muscle that it takes to compete with its arch-rival iOS.
AOSP on Steroids
While Google continues to push its proprietary services taking back the openness of Android, and OEMs struggle to please users by selling their bloatware-ridden phones, a few good things have came out in this mess; alternative Android ROMs. These are variants of Android based purely on AOSP, but they add some neat tricks that AOSP can't do out-of-the-box, these ROMs are developed by community, they are free to use and they keep the openness of Android intact. CyanogenMod, Paranoid Android and MIUI (although MIUI is not fully open source) are popular such custom ROMs based on AOSP.
Custom Android ROMs, though started out as an experiment to get around AOSP, have now become real threat to Google's Android. Why you ask? CyanogenMod and MIUI are shining examples. Firstly, CyanogenMod is now a company, re-branded as Cyanogen, Inc. The company which started out as a team of hackers who created custom ROM for every popular/flagship Android device ever made, is now partering with OEMs like Oppo, OnePlus (with some controversy), YU, Blu and Alcatel to ship phones running Cyanogen OS. The company recently had funding of about $80 million from Twitter, Qualcomm, Andreessen-Horowitz and many others, which clearly suggests how big it has become. The company CEO Kirt McMaster even claimed to put a bullet through Google’s head in an interview with Forbes.
Not only ROM-makers are threatening to dethrone Google's Android; Xiaomi, the company behind MIUI, is actually doing it. A mere five year old chinese Internet company, which started the project MIUI, along with its foundation, back in 2010, started into smartphone business with its first flagship, Xiaomi Mi1, for its home market China. Part of the reason why MIUI created was that the great firewall of china blocked several of Google's services including Gmail and Search, so a platform was needed, as robust and rich as Android, but sans Google. The company has its sales model very different compared to other OEMs; it doesn't have retails stores, it doesn't spend any money in marketting and advertisement and it solely sells its devices online from their website. Having all the major expenses skipped, Xiaomi manages to sell its devices at ridiculously cheap price, while keeping flagship specifications. With this disruptive strategy, Xiaomi single-handedly damaged several veterans of the industry, including Apple and Samsung.
A Lonesome Fight
Ever since the release of iOS, Apple is solely battling (and winning periodically) with competition, which is not just limited to Android, but Windows Phone, BlackBerry, etc. The same fate has now come to Google, either it let's the Android go on its way to become open platform, which it originally was, or continues to lure users to stay loyal to its vision of Android, which is not open. Moreover, this twist of the story has came right when Android is fully mature to compete with old enemies; iOS, Windows and BlackBerry. But instead, Android is struggling to keep up against itself.