It everything to do with their business model. Joel Spolsky called it commoditizing your complement (google it).
Re:Who Does That Server Really Serve?
by GeneralMayhem on Friday December 26, 2014 @12:51PM
(#8799478)
I'd expect some of the bigger R&D moonshots to go first - Loon, Wing, etc. The open source contributions are good PR with the software development community.
Let's look at Google...
Android - Get people to use Google products on mobile. Adsense - Add ads to your site. Analytics - Track how users use stuff to provide better ads. Gmail - Track your email to serve you better ads. Google Search - Serve you ads.
Sure they have Dart, Angular, etc which they developed for use internally and then released to the public. But do you honestly think that has anything to do with their business model? They hired smart people, and smart people design things. Those people then released them as open source. But do you honestly believe if Google was to start (theoretically) having money issues, those products would not be the first to go?