I think the tax bill from last year helped some with this[0]. Apple announced that they would be bringing back billions of $ from overseas holdings due to changes in the laws, and investing it in the US.
Google has been expanding in NYC for a while. Back in February, they bought their existing building for $2 billion[1].
[0] https://www.nytimes.com/2018/01/17/technology/apple-tax-bill...
[1] https://nypost.com/2018/02/06/google-to-buy-chelsea-market-b...