How? With 23,000 employees you can staff up a lot of internal projects. And with $30 billion in cash you can afford to acquire a lot of external projects.
Why? I think Google has a different philosophy than Apple. Where Apple seems like a design shop with a minimalist ethos (its highly-polished product line famously fits on a conference room table, and it prides itself on what it doesn't do), Google seems more like a start-up incubator hoping, by early release and rapid iteration, to see some of its ideas catch on, knowing all along that many will fail.