Oil markets have been very volatile in recent years. In 2020, the price per barrel fell below $25, only to zoom past the $100 market two years later. Today, oil prices are hovering around $70 per barrel. If you're looking for oil stocks that can thrive in varying conditions, the two companies below are for you.

Trust in superior capital allocation

In many ways, oil companies are just glorified capital allocators. Management must constantly decide where to redirect its profits, whether directly to shareholders through dividends and share buybacks or to growth initiatives, such as acquiring a competitor or expanding a drilling site.

Capital allocation in the oil space can be difficult because a company's survival is often deemed a higher priority than shareholder profits. For instance, a company might get lucky on a certain well and generate hundreds of millions of dollars in free cash flow over the well's lifespan. While the best thing to do might be to simply send this free cash flow back to investors, management often gets involved in empire-building. That is, they acquire all sorts of additional assets that may not have the same return profile as the original well -- potentially squandering the original golden goose.

All this is to say that capital allocation is key when it comes to identifying profitable oil stocks. How can we tell how good a company has done at investing shareholder wealth? Return on equity (ROE) gives us an idea of how much a company is earning for shareholders, while return on invested capital (ROIC) captures value creation for both debt and equity holders. On this front, Chevron (CVX 0.78%) -- one of the world's most recognizable oil brands -- comes out looking pretty good, with long-term ROE and ROIC averages in the double digits.

It hasn't always been a smooth ride. Even Chevron has struggled to maintain its average return profile during recent volatility. But as the past year or two has proven, Chevron has the financial might and long-term vision to bounce back from operational challenges. And it's not like the stock is overly expensive. Shares trade at just 15 times earnings -- roughly half the market average -- and sport a free cash flow yield above 6%.

It's not the flashiest pick, but there's a reason Chevron shares have attracted the eye of Warren Buffett, who owns around 6.5% of the company. Buffett likes companies that put shareholder interests first. And while it hasn't always been perfect, Chevron has a multidecade track record of success.

CVX Return on Equity Chart

CVX Return on Equity data by YCharts.

Get more growth with this oil stock

Warren Buffett isn't only a fan of Chevron's capital allocation. He also loves Occidental Petroleum's (OXY 1.41%) CEO, Vicki Hollub, who he believes is "running the company the right way." By that, he likely means she's prioritizing profits over production -- which, as mentioned, can be difficult to accomplish when it comes to capital allocation.

Comparing Occidental's ROE and ROIC metrics against Chevron gives you an instant assessment of how each business is run. Chevron benefits hugely from allocating capital to midstream and downstream segments, including pipelines, refining, and distribution.

These segments insulate Chevron from market swings, as the profits in one division can be used to offset losses in another. For that reason, its returns have been relatively steady. Occidental, meanwhile, has experienced huge fluctuations in ROE and ROIC, given that it's heavily reliant on its upstream operations. That is, it's more exposed to fluctuating oil prices than an integrated producer like Chevron.

CVX Return on Equity Chart

CVX Return on Equity data by YCharts.

If Chevron is a reliable bet if you're unsure of where oil markets are headed next, Occidental makes a great investment if you believe oil prices are set to rise. After leveraging its balance sheet to acquire CrownRock -- a shale producer with assets in the Permian Basin -- the company is set to make around $260 million in additional cash flow for every $1 increase in oil prices. If oil prices hit 2022 levels, Occidental could generate more than $10 billion in additional cash flow -- 20% of its current market cap.

Was the CrownRock acquisition an attempt to chase profits? Or was it a wise strategic decision, alongside the rest of Occidental's capital allocation plan, that incorporates dividends, share buybacks, and debt repayments? The answer will depend on where oil prices head over the next few years. If you're bullish, few investment options are superior to Occidental, given its direct leverage to rising prices.