Google, Facebook, Microsoft and Twitter are engaged in a costly tech arms race, with their businesses and cultures at stake.