If you've been tracking the Gilead Sciences (NASDAQ:GILD)/AbbVie (NYSE:ABBV) Hepatitis C match-up during the last year, you've seen what a one-sided fight looks like. In HCV, Gilead's drugs Sovaldi and Harvoni are the undisputed leaders, with $10 billion plus in combined sales in 2014 and 2015. And Viekira Pak -- on track for less than $2 billion in 2015 -- is a distant third.

Harvoni and Sovaldi have significant advantages over Viekira Pak -- most notably better dosing and a superior side-effect profile -- and they highlight a cornerstone of Gilead's strategy. CFO Robin Washington put it best at the recent Nasdaq Investor Program by noting that: "It's important to us to have best-in-class molecules. We try to develop them in-house, but if there are opportunities external... we take advantage of those." (Quote courtesy of S&P Capital IQ.)

That's why it was so weird to learn that Gilead paid $725 million upfront to license a drug that AbbVie had previously rejected. It didn't seem to fit. After all, why would a company with such high standards pick up another company's proverbial trash?

It turns out, of course, that there's more to the story than meets the eye.

Breaking it down
The drug, by the way, is called filgotinib, and it's targeted at inflammatory diseases. Galapagos NV (NASDAQ:GLPG), filgotinib's developer, reported positive phase 2 data earlier this year for the drug in both rheumatoid arthritis and Crohn's disease. Galapagos and Gilead plan to begin phase 3 trials in 2016.

Peak sales estimates for the drug are impressive -- as high as $2 billion according to one analyst -- which then begs two questions:

  1. Why would AbbVie ditch a drug with multi-billion dollar potential; and
  2. Was this the right move for Gilead?

AbbVie's reasoning for ditching the drug in September looked sound at the time -- and to some extent still does. Filgotinib had some troubling data that it might be toxic to the testicles. Plus, AbbVie has its own competitor drug, ABT-494, which had recently reported positive data in a midstage trial. And because ABT-494 was wholly owned by AbbVie, there'd be no need to pay royalties on it, unlike for filgotinib (and some estimates are that royalties on filgotinib would have cost AbbVie $1 billion or more in total).

What AbbVie had with filgotinib was a drug with some concerning data that, even if successful, would cost AbbVie extra because of royalties. Contrast that with another its own drug for similar indications that had reported great data and would be more profitable. Pretty easy to see why AbbVie made the choice it did.

Enter Gilead
Then, Galapagos reported positive filgotinib phase 2 data in Crohn's disease earlier this month, and at least partially resolved concerns about the drug's potential toxicity. For Gilead Sciences, which hasn't been shy about admitting its interest in adding new drugs to its pipeline, this is a solid deal. A brief look over Gilead's history shows that the company prefers to pay extra for drugs that have already been de-risked instead of taking moonshots on lots of early-stage assets, and buying rights to filgotinib fits in nicely with that strategy.

The price isn't bad either -- the $725 million Gilead is paying upfront includes a $425 million equity investment in Galapagos, meaning that Gilead will own roughly 15% of Galapagos after the deal has closed. Gilead has also offered $1.35 billion in potential milestone payments to Galapagos, plus tiered royalties starting at 20%, and the option for Galapagos to co-promote filgotinib in certain European countries.

Without knowing all the details, it's impossible to precisely work the math for the deal. But getting the vast majority of a drug's potential sales for around one times peak sales estimates looks like a very good price for Gilead. (Biotech buyouts usually happen at two times or three times peak sales.) Owning around 15% of Galapagos is a nice kicker, as the company has plenty of potential upside with two drugs in phase 2/3, two in phase 1, and a number in preclinical.

Who wins?
There's no way to predict who will win when these drugs (and a variety of competitors) hopefully get to market. And it's hard to blame AbbVie for its decision to cut filgotinib loose. Based on the data available at the time -- and the fact that AbbVie had a competitor in development -- it makes sense for the company to save money and focus its resources on the more profitable opportunity.

As I think everyone learned in Hepatitis C and HIV, Gilead Sciences will exploit any opening in a disease area of interest to the company -- and now it's beefing up an otherwise mostly early- and mid-stage autoimmune pipeline. That's great news for Gilead investors as the company works to diversify from a heavy reliance on HIV and Hepatitis C.

Michael Douglass owns shares of Gilead Sciences. The Motley Fool owns shares of and recommends Gilead Sciences. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.