2020 was a tough year for ExxonMobil (XOM 0.02%) and the broader oil and gas industry. Supply outpaced demand as the COVID-19 pandemic wreaked havoc on energy prices. In 2020, energy was the worst-performing sector in the S&P 500, and ExxonMobil stock reached its lowest levels since 2003. At its worst point, ExxonMobil's market cap fell below Zoom Video Communications (ZM 0.05%). This is hard to believe considering today -- less than two years later -- ExxonMobil has a market cap above $320 billion and Zoom is worth less than $40 billion. 

Energy stocks were the best performing sector in 2021, and have so far been the best industry in 2022 as oil prices approached $100 per barrel. Yet there are still bargain stocks in the oil and gas space. Midstream giants Kinder Morgan (KMI 0.27%) and Plains All American Pipeline (PAA 1.11%) remain a good value for long-term investors. Here's what makes each energy stock a great buy now.

A man welding an above-ground pipeline.

Image source: Getty Images.

A 6.7% dividend yield you can count on

Daniel Foelber (Kinder Morgan): The oil and gas industry is known for its volatility, but it's also home to some of the highest-yielding dividend stocks in the market. However, long-term investors know that a reliable dividend backed by a good business is always better than a high yield built upon a house of cards.

Certain hidden gems even combine reliability and a high yield. Meet Kinder Morgan, which is one of the most reliable and highest-yielding dividend stocks in the S&P 500.

Kinder Morgan is in the business of building energy infrastructure projects like pipelines and terminals that support the transportation of natural gas, oil, and CO2. Unlike an exploration and production company that booms and busts alongside oil and gas prices, Kinder Morgan has stable take-or-pay and fixed-fee contracts that insulate its business from downside risk. This resilience was put on display in 2020, when Kinder Morgan's full-year distributable cash flow (DCF) and adjusted EBITDA only fell by 8% and 9%, respectively. It also booked a profit in 2020.

Meanwhile, ExxonMobil lost $22.4 billion in 2020, the worst annual performance in company history. To put that loss into context, consider that ExxonMobil booked a profit of just over $23 billion in 2021, meaning despite last year's high oil and gas prices ExxonMobil barely broke even between 2020 and 2021. 

Kinder Morgan stock is underperforming the broader energy index for good reason in that Kinder Morgan isn't exposed to the upside of higher oil and gas prices as much as other companies. However, Kinder Morgan generates a ton of DCF that it can use to grow its dividend. Whether oil and gas prices are high or low, investors can count on Kinder Morgan's dividend. Kinder Morgan plans to raise its dividend to $1.11 per share in 2022, giving it a dividend yield of 6.7%. That's a high enough yield to supplement income in retirement, offset inflation, or generate a sizable low-tax passive income stream.

A ridiculously cheap oil stock

Matt DiLallo (Plains All American Pipeline): Oil pipeline company Plains All American Pipeline hasn't run up as much as Exxon. Over the past year, it's gained less than 25% compared to Exxon's 55% rally. Because of that, the oil-focused master limited partnership (MLP) still trades at a relatively low valuation.

This year, the oil pipeline company expects to produce $2.08 per unit of distributable cash flow. With the MLP recently trading at around $10.50 per unit, it sells for about five times its cash flow. That's ridiculously cheap for a company that generates very stable cash flow.

Thanks to that low valuation, Plains All American Pipeline currently offers a high dividend yield. At its current distribution rate, the MLP yields 7.1%, well above Exxon's 4.6% yield. However, it plans to increase its payment by nearly 21% this year, implying a yield above 8%. While a payout that high might seem suspect, Plains All American can cover it with cash flow by a whopping 250% this year.

That's leaving the oil pipeline company with excess cash to expand its oil pipeline operations, repay debt, and repurchase its deeply discounted units. It plans to invest about $500 million on expansion projects and allocate 75% of its remaining free cash for debt reduction. It aims to return the rest to investors via the higher distribution and its repurchase program. As debt goes down, the company expects to send even more money back to investors in the future.

With a cheap valuation and high dividend yield, Plains All American looks like a compelling value play in the oil market for those who feel they missed out on Exxon.

Bankroll your passive income stream with quality energy stocks

Investing in equal parts of Kinder Morgan and Plains All American Pipeline would give an investor an average dividend yield of 6.9%. Both companies also appear to be a good value now, with Kinder Morgan having a 21.3 price-to-earnings (P/E) ratio and Plains All American Pipeline sporting a 18.2 P/E ratio. As tempting as it may be to chase higher oil and gas prices through riskier upstream oil stocks, income investors are likely better off going with a dividend they know can outlast economic cycles.