Source: Kinder Morgan.

Kinder Morgan (NYSE: KMI) and Enterprise Products Partners (NYSE: EPD) are both giant midstream companies. Kinder Morgan has a market capitalization of $37 billion and owns an interest in or operates 84,000 miles of pipeline. Enterprise Products Partners sports a market cap of $48 billion and owns more than 48,000 miles of pipeline. 

Although they're both large, Kinder Morgan and Enterprise Products Partners have experienced divergent fortunes over the past few quarters. Because of debt market volatility that has made raising growth capital difficult, Kinder Morgan cut its dividend by 75% late last year. Enterprise Products Partners, on the other hand, raised its dividend because of its strong coverage.

Given the crude rally in recent weeks, which stock is the better buy?

Enterprise Products Partners is better if energy prices remain depressed
If energy prices stay depressed, Enterprise Products Partners is the safer bet. Enterprise has a better balance sheet, with a debt-to-adjusted EBITDA ratio of 4.2, versus Kinder Morgan's 5.6. 

Enterprise is also a good bet to raise its dividend over the next few years if prices stay low. Because of its low leverage, long-term contracts, and efficient operations, Enterprise has raised its cash distribution for 46 straight quarters. Enterprise had a distribution coverage of 1.3 for 2015, and management has said it plans to raise the distribution by $0.015 per quarter for reach of the next four quarters.  Given Enterprise's strong finances and management's previous track record of execution, Enterprise's current quarterly dividend of $0.39 per share, which translates to 6.5% yield at current prices, is very attractive, particularly in today's low-yield environment.

In contrast, Kinder Morgan is unlikely to raise its dividend anytime soon, because its management is more focused on growth projects and controlling the company's debt. 

Kinder Morgan is better if energy prices rally
If crude prices rebound to $60 per barrel or higher and natural gas prices rebound, Kinder Morgan has more upside. Kinder Morgan has a more ambitious growth program, with the company planning to spend $18.2 billion in growth capex over the next five years in an effort that managements expects to yield approximately $2.2 billion of incremental EBITDA. Enterprise, by contrast, has about $6.6 billion major capital projects planned from the beginning of 2016 to the end of 2018. Both companies have enterprise values of around $70 billion to $80 billion. 

If energy prices rise, the market will probably look more favorably on growth capital expenditures and won't care as much about higher debt-to-EBITDA ratios. If that occurs, the capital market could open up to Kinder Morgan more and allow Kinder Morgan to raise its dividend if external financing becomes affordable again.

Enterprise Products Partners is the winner, though
Given that energy fundamentals are on an upward trajectory, Kinder Morgan has more upside under current conditions. US. crude production is currently falling at a rate of around 100,000 barrels per day per month, and and total global demand is expected to grow 1.1 million barrels for 2016. The International Energy Agency has said that crude prices "may have bottomed out," and crude prices are substantially higher than where they were in the middle of February. If current trends hold, the oversupply situation could dissipate by early to mid-2017, and crude prices could trade for $50 to $60 per barrel or higher.Under that scenario, the market would view Kinder Morgan more favorably, and investors could send Kinder Morgan stock up more than Enterprise's. On a book valuation level, Kinder Morgan is also cheaper than Enterprise. At its current price, Kinder Morgan trades for 1.08 times book value, versus Enterprise's 2.3. 

Given that energy fundamentals could reverse if OPEC fails to freeze production or U.S. production proves to be more resilient than expected, however, Enterprise Products Partners is the better all-around pick. With its low debt-to-adjusted EBITDA ratio and its 46 straight quarters of dividend raises, Enterprise Products Partners is more conservatively run than Kinder Morgan and its management has greater credibility. Given Enterprise's 1.3 times dividend coverage and the company's low sensitivity to crude price fluctuations, Enterprise will likely continue to pay its attractive dividend. In times of industry stress, being more conservative, having greater credibility, and paying investors a stable dividend helps Enterprise retain its value better.

Enterprise will also do well if energy prices rise. If energy fundamentals improve, many investors that sold out of Enterprise on the fear that the sector troubles could precipitate a Kinder-Morgan-like-growth-capex crisis might buy back in for the safe yield, and send Enterprise's stock higher.