This is how I've been told it went by in Germany: there was a law drafted[1] that said publishers should get compensation for snippets of their articles in search results. This was a law apparently drafted directly in response to Google's practices.
So Google sent a letter to most publishers, asking for royalty-free access to their content, or otherwise they would not show up anymore on Google's services. All publishers agreed to sign that, because being removed from Google means losing a decent amount of your ad income.
That's how they get away with it.
[1] https://gigaom.com/2013/03/01/german-parliament-passes-googl...