That is not new. They've been doing that since the 2000s.
The way I understand it is that there are at least two reasons, maybe more:
- Google (like all tech companies) uses a lot of open source software internally, so benefits from it being improved
- Google wants to train possible future employees
Not everything Google or other big tech companies do is necessarily bad; we should be taking advantage of the good parts of what they do.