Apple is reportedly buying Beats Electronics for $3.2 billion — a whopping sum for a brand that, although popular, tends to be scoffed at by audiophiles.

So everyone wants to know: Why is Apple buying Beats when it could be investing in practically any other company?

One answer floating around is that Beats gives Apple valuable street cred among the cool kids. While Beats is undeniably cool, this theory seems hard to swallow. It's not like Apple is uncool.

More compelling is the idea that Apple wants to get its hands on Beats's technology. Some see the potential acquisition as play for Beats Music, Beats Electronics's streaming music service. As Peter Kafka over at Re/code points out:

If Apple wanted to, it could certainly have built a streaming subscription service itself; the company had been floating the notion of one with label executives in recent months. But it’s possible that Apple’s most recent attempts to extend its music business beyond the iTunes store helped convince [Apple CEO Tim] Cook that he was better off getting outside help.

This makes some sense considering Apple's habit of missing with online services. Before iCloud came along in 2011, Apple made three other attempts at building a cloud-based product. All of them saw mixed success. Part of the reason iCloud has stuck around so long is because Apple has integrated it into many of its products by default, much like Google has made Google Plus an underlying part of many services it offers. For instance, Apple's iOS requires customers to use iCloud as an intermediary when syncing address books to new Macs.

There's iTunes, of course, which helped Apple revolutionize the music sales industry. But the rise of streaming media, including Pandora and Spotify, threatens the idea of purchasing one-off singles. What's more, critics say iTunes has become a bloated piece of software that tries to do too much. Whenever Apple comes up with a new software feature and doesn't know where to put it, it gets shoved into iTunes.

Apple's lackluster track record with cloud-based offerings may suggest the company needs all the help it can get. (Why it didn't buy up a more prominent music streaming service, such as Spotify, is still a mystery.)

More broadly, Apple faces a long-term challenge. People turn to Apple for hardware — iPhones, iPads, and the like — but the future is all in online services. Ninety percent of Americans have a cellphone these days, and more than 60 percent own a smartphone. Sales of mobile devices are flagging. Wearable technology is still being refined.

Apple needs to find a winning formula in the cloud. And soon.