Facebook posted a $642m profit in the first quarter of 2014 while Apple reported $10.2bn profits for the same period, beating analysts’ expectations.

But how?

While Facebook’s profits rode on mobile advertisements, Apple made it by selling 43.7 million iPhones in the first three months of this year.

Facebook’s revenues jumped by 72% to $2.5bn, with $2.27bn coming from advertising. Mobile advertising revenue formed 59% of the total revenues, an increase of nearly 30% year-on-year.

During the quarter, Facebook bought mobile messaging service WhatsApp for $19bn, an indication of the company’s strategy to invest more in its mobile services.

There is also speculation that it plans to launch a mobile advertising network at the F8 developer conference later in April.

Facebook founder and CEO Mark Zuckerberg said: "Facebook’s business is strong and growing, and this quarter was a great start to 2014.

"We’ve made some long-term bets on the future while staying focused on executing and improving our core products and business. We’re in a great position to continue making progress towards our mission."

Meanwhile, Apple earned revenues of $45.6bn, compared to $43.6bn a year ago.

The iPhone maker said it will buy back $30bn more shares, in an increase of its buyback plan from $60bn to $90bn.

Apple CEO Tim Cook said: "We’re very proud of our quarterly results, especially our strong iPhone sales and record revenue from services.

"We’re eagerly looking forward to introducing more new products and services that only Apple could bring to market."