Source: BP p.l.c.

When it comes to energy giant BP (NYSE:BP), there seem to be plenty of reasons to avoid the stock. That's because BP faces a set of risks that are both industrywide and company-specific. When it comes to oil and gas companies in general, operational headwinds include lagging production due to field declines, as well as a very poor downstream environment marked by collapsing refining margins.

As far as BP itself is concerned, the company faces an uncertain outcome of the civil trial pertaining to the 2010 spill in the Gulf of Mexico. In addition, a new headache has emerged in the form of BP's exposure to Russia through its investment in Rosneft.

Add it all up, and you'd be hard-pressed to come up with any reason whatsoever to invest in BP. But, since the start of the year, that's exactly what you should have done. Read on to discovery why that could be.

BP is winning the expectations game
BP's stock price is up about 5% year to date, without even including the benefit of its industry-leading dividend. The stock has outperformed the market, but you may be scratching your head as to why. After all, the prospect of economic sanctions against Russia could deal a severe body blow to BP's equity position in Rosneft, and the outcome of the 2010 civil trial is still uncertain.

The reason might be that the negative impacts facing BP were priced into its valuation already. It's true that BP's first-quarter earnings report looked ugly on the surface. BP reported a core profit of $3.2 billion, down 24% year-over-year. But that was still $100 million better than the average analyst forecast. In other words, the market was overly pessimistic about the state of BP's operations.

Consider that BP trades relatively cheaply based on its cash flow generation when stacked up against its competitors. BP exchanges hands for about 5.8 times its enterprise value to EBITDA multiple. This measure analyzes a company's enterprise value, which is its market capitalization plus cash minus net debt, versus its operating cash flow.

Meanwhile, Chevron (NYSE:CVX) trades for 7.5 times enterprise value to EBITDA, or a roughly 30% premium to BP. This is despite the fact that Chevron's profits fell 18% last year, so it's not as if the company is doing that much better than BP fundamentally. And, Chevron has already warned investors not to expect much for the first quarter.

Plus, BP's ability to increase cash distributions to shareholders has been a welcome surprise that the market was not anticipating.

Funneling cash back to investors
BP provided another surprise when it announced a dividend increase recently. It plans to increase its dividend to $0.0975 per ordinary share. In terms of its NYSE-listed ADS, this would amount to a dividend of $0.585 per share, which represents a nearly 3% increase. In the immediate aftermath of the 2010 spill, BP was forced to suspend its dividend. Once it started its payout again 10 months later, it resumed its dividend payments at half their pre-spill levels. Since that time, BP has increased its dividend four times to its current level. BP's dividend hikes signify how far it has come back since the Gulf of Mexico spill.

Another round of cash is about to be sent back to shareholders in the form of strong share buybacks. BP announced an aggressive divestment program with the goal of streamlining its operations and becoming a more focused company. By the end of next year, BP plans to unload $10 billion in assets, the proceeds from which will be utilized primarily to buy back shares. Considering BP's low valuation, this is another move that will likely be beneficial for shareholders.

The bottom line for investors is to remember that even though BP's results are by no means impressive, they are nevertheless better than what the market was previously giving it credit for. Above all else, the market wants certainty. Even though BP faces billions in penalties upon the conclusion of its ongoing civil trial, and its investment in Rosneft is likely to take a hit, those factors were already priced into its valuation.

Now that the smoke is beginning to clear, the market is realizing that the situation facing BP isn't as dire as feared. BP is proving as much by accelerating its share buybacks and repeatedly increasing its dividend.

Bob Ciura owns shares of BP p.l.c. (ADR). The Motley Fool recommends Chevron. 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.