The latest batch of tech-industry earnings show how two technology trends—mobile and the cloud—are taking root and delivering big profits for the companies that bet on them.

Facebook Inc. and Google parent Alphabet Inc. last week both reported surges in their quarterly profits, fueled by users spending more time on their smartphones and advertisers spending more money to reach them there.

Meantime,...