Companies like Facebook and Google are spending billions to own digital platforms where users shop, talk and seek entertainment.