It has been a wild ride for investors in Kodiak Oil & Gas Corp's (NYSE: KOG) stock this year. An announcement that it was merging with Whiting Petroleum Corp (WLL) sent the stocks of both companies higher earlier this year. However, more recently a plunge in oil prices has reversed the bulk of those gains, as we can see from the following chart.

KOG Chart

KOG data by YCharts

That being said, Kodiak Oil & Gas investors have still enjoyed gains of more than 20% on the year, which is more than double the return of the S&P 500. Here's why.

Handing over the keys at the right time

Kodiak Oil & Gas started the year on a sour note. A rough winter wrecked its first-quarter and put the company so far behind that it was forced to reduce full-year production guidance. That caused the stock to sell off more than 5% on the news, which wasn't surprising given that it was one of the few companies that was not able to overcome the rough winter in North Dakota. Kodiak Oil & Gas blamed the miss on the fact that it drilled a lot of wells just to hold acreage and those wells performed poorly. However, the poor well performance caused investors to question whether or not the company's remaining acreage was any good.

Those questions were answered in a way when Kodiak Oil & Gas announced it was merging with Whiting Petroleum for a lower price than the company's stock was trading for just the week prior to the merger announcement. In fact, it was just a paltry 5.1% premium to the company's average trading price over the prior 60 days. So, clearly Kodiak Oil and Gas saw more value in handing over the keys of its growth engine to Whiting Petroleum than with continuing to drive ahead as an independent company.

However, because it was a stock-for-stock merger, Kodiak Oil and Gas investors have seen the value of their shares surge higher as investors in both companies have embraced the combination. This is why Kodiak Oil and Gas' stock is up 20.87% this year instead of just the meager 5.1% premium Whiting Petroleum offered it in the merger.

Why investors are embracing the merger

The reason investors have been buying into this merger is two-fold. First, the combination will make Whiting Petroleum the top oil and gas producer in the Williston Basin. While it won't be the largest acreage holder it will still have more than 3,400 future drilling locations, giving it plenty of future growth opportunities. Moreover, the greater scale should bring down costs and improve efficiency in a way that neither company could achieve on a stand-alone basis. In fact, Whiting Petroleum expects to see Kodiak's well costs drop by $700,000 per well.

However, more importantly for Kodiak Oil and Gas investors is the fact that Whiting Petroleum isn't a one basin operator like Kodiak. This matters because Whiting can invest elsewhere during the rough winter months that plague North Dakota so that it doesn't start the year on a sour note. As the following slide notes Kodiak Oil and Gas will go from 100% Williston Basin focused to just 61% reliant on that basin when measuring proved reserves.

Source: Whiting Petroleum Corp Investor Presentation. 

In addition to diversifying production and reserves away from the Williston Basin, Kodiak Oil and Gas investors will also have access to Whiting Petroleum's newest growth asset, the Redtail prospect in the Niobrara shale in Colorado. Whiting Petroleum is seeing its production surge as it develops this new play, and it sees plenty of growth in the years ahead. In fact, the company sees just as many future wells in its Redtail development areas as it does in the Williston Basin. This second leg of growth is something that was severely lacking at Kodiak Oil and Gas, which is why the combination makes sense from a strategic standpoint.

Investor takeaway

Kodiak Oil and Gas' stock has performed well this year almost entirely because it's merging with Whiting Petroleum. If that merger wasn't announced this likely would have been a tough year for investors as a poor start to the year could have made it even harder for the company to overcome the recent slide in oil prices.