Google never really integrated phone-maker Motorola Mobility into the rest of its business after paying $12.5 billion for it back in 2012, and now it's a good thing since it's going to unload the money-division to Lenovo for a bit less than $3 billion in cash and stock.
On its face that's a ~$9 billion price for some of Motorola's patents, which looks terrible. But Google sold Motorola's set-top box division already for ~$2.3 billion, and also acquired about $3 billion in cash when it acquired Motorola. So on net it's more like they come away about $5 billion poorer and in exchange get the patents. Not a great deal but not a terrible one.*
For Lenovo it's basically a cheap way to get into the handset market. The Chinese PC manufacturer is doing well in that industry, but the PC industry as a whole seems to be shrinking for reasons that are outside its control. Looking to break into other related markets, it bought IBM's low-end server business earlier this month and now it's getting into handsets. Of course one reason why Motorola was the cheap way into handsets is that it's losing money. Add an unprofitable business to a shrinking business and it's not clear that you've hit the jackpot.
For Google maybe the best way to understand this is that Motorola as an operating entity was more trouble than it was worth.
The basic problem at Motorola is this: There was a problem at Motorola. In principle, Google could have tried to step in and do stuff to fix the problem. But the success of Google's Android platform requires other handset makers to have confidence in Google's basic neutrality as a platform owner. Trying too hard to fix Motorola would imperil those relationships. But not fixing the problems would just leave an open sore. Clearly, Google overpaid for Motorola back when it bought it. But simply because it overpaid in the past isn't a good reason to make excessive demands now. Unload the thing and move on.
* CORRECTION: The initial version of this post ignored the value of Motorola's cash and set-top box division, and thus substantially overstated Google's financial losses in the deal.