Apple has just confirmed plans to purchase Beats Electronics for $3 billion. The acquisition ranks as the largest that Apple has ever made and will see it take ownership of an enormously successful and profitable line of consumer headphones as well as a burgeoning subscription music service. Beats co-founders Jimmy Iovine and Dr. Dre will also join Apple as part of the acquisition, which it will pay for with $2.6 billion in cash and $400 million in stock.

Apple sees Beats' focus on music as complementary to its own, and it'll have Iovine and Dre working with it on future music offerings. "They’re going to be coming up with [features] that blow your mind," Apple CEO Tim Cook tells The New York Times, "and products you haven’t thought of yet, and seeing around the next corner to articulate the way to take music to an even higher level than it is now."

"I’ve always known in my heart that Beats belonged with Apple."

The two brands will remain separate and will even continue to offer casually competing services, including iTunes Radio and the recently launched Beats Music subscription service. Beats Music and Beats' headphone and speaker division will still be answering directly to Apple, however, with iTunes chief Eddy Cue taking charge of the former and marketing chief Phil Schiller taking the latter. Though this is a relatively huge purchase for Apple — which usually only buys smaller companies — the cost is far less meaningful to it thanks to its sizable stockpile of cash.

While Beats is known for its headphones, its music subscription service certainly played a big part in helping it land at Apple. Apple has been a juggernaut and a leader in digital music sales since the beginning of the last decade, but it's failed to keep up as consumers have begun transitioning to streaming services. Now Apple thinks that it's found a winner in Beats Music: "We love the subscription service that [Beats] built," Cook tells The Wall Street Journal. "We think it's the first one that really got it right."

Cook's analysis may not be shared by the public, which seems to have taken a fairly tepid response to Beats Music, but it's far from too late for it to catch up on subscription music. Though Spotify has taken a wide lead, subscription services still haven't reached a ubiquity, meaning there's plenty of market share left to take. According to the Financial Times' Tim Bradshaw, Apple will even keep Beats Music around on Android and Windows Phone after the acquisition.

Sharing a laugh with Jimmy, Dre, and @cue. Excited to welcome the #Beats team to #Apple. It's all about the music. pic.twitter.com/ZwyWgHFwhO — Tim Cook (@tim_cook) May 28, 2014

Beats' headphones are another matter. Apple already sells Beats in its own stores and has known exactly how well they're selling — and at what margins. They'll give Apple a formidable presence in the market of a popular accessory. And beyond that, it's undeniable that Beats and Dr. Dre bring with them a certain hip factor, which is exactly what Apple has been taunted of late for losing.

In an interview, Recode presses Cook further on how the Beats acquisition fits into Apple's business. Cook admits that Apple could have built its own subscription service and headphones, but he sees Beats as offering far more than that thanks to "incredible" and "creative" people — particularly Iovine and Dre. Beyond that, Cook reiterates that he sees Beats' business as being strongly complimentary to Apple's, saying that there's much more they can do together in the future.

The deal was "inspired by Apple’s unmatched ability to marry culture and technology." "The point is that Jimmy and Dre have built something phenomenal. And they have phenomenal skills," Cook tells Recode. "And we can begin, the instant that this deal is approved, working on the future together. And I think that future is better than either company could create on their own."

The deal is expected to close by this fall and is still subject to regulatory approval. After the deal closes, Iovine will also leave his position as CEO of the music label Interscope, where he's been in charge for 25 years, according to Billboard.

"I’ve always known in my heart that Beats belonged with Apple," Iovine says in a statement. "The idea when we started the company was inspired by Apple’s unmatched ability to marry culture and technology. Apple’s deep commitment to music fans, artists, songwriters and the music industry is something special."

The pending buyout was first revealed by The Financial Times on May 8th. Soon after, Beats co-founder Dr. Dre all but confirmed the deal by appearing in a celebratory video posted (and promptly removed) by Tyrese Gibson. In the clip, Dre described himself as "the first billionaire in hip-hop," alluding to the massive financial payoff he's due to receive thanks to Apple's big buy. Speculation about just what Apple sees in Beats and its leadership has been running rampant ever since the acquisition was publicized.

"Music is such an important part of all of our lives and holds a special place within our hearts at Apple," Cook says in a statement. "That’s why we have kept investing in music and are bringing together these extraordinary teams so we can continue to create the most innovative music products and services in the world."

Jacob Kastrenakes contributed to this report.