Warren Buffett's company Berkshire Hathaway (BRK.A -0.28%) (BRK.B -0.68%) thumped the stock market in 2022. The stock pulled out a 4% gain, while the S&P 500 fell a whopping 19.4%.

But so far in 2023, the broader market has a big lead on Berkshire, with the S&P 500 up about 7.4% and Berkshire's stock down about 1.2% for the year. It's still early, though, and Berkshire could certainly turn things around given the uncertain outlook right now. Here's how.

Why is the market outperforming?

The market is largely outperforming right now due to the belief that inflation has peaked and is finally heading south after consumer prices shot up in 2022. The market also seems to believe that the Federal Reserve will soon begin slowing the aggressive interest rate hiking campaign that it first embarked on last March. The Fed's overnight benchmark lending rate, the federal funds rate, has risen from practically zero last March to now inside a range of 4.50% to 4.75%.

Warren Buffett.

Image source: Motley Fool.

Rising rates tend to hurt a lot of stocks because they make the cost of doing business more expensive and reduce the future value of cash flows. Furthermore, rising interest rates lead to rising bond yields, which makes safer assets like government-backed bonds pay out more. 

I think many investors saw Berkshire as a flight to safety as inflation was rising. The company is exposed to many different sectors of the market other than tech, which fell even more than the broader market in 2022. Berkshire also keeps a ton of cash on hand so it can be nimble in a number of different environments, and many of its businesses -- like insurance, energy, and railroads -- held up pretty well last year, despite the tough environment.

How Buffett and Berkshire can turn things around

A big part of Buffett and Berkshire's investment philosophy as of late seems to be around U.S. domestic oil and gas companies like Occidental Petroleum (OXY -0.09%) and Chevron (CVX 0.44%), which Berkshire took massive stakes in last year. Berkshire also owns and operates several energy subsidiaries under Berkshire Hathaway Energy.

This means that Berkshire could benefit if oil prices rise this year. Currently, U.S. oil prices are around $73 per barrel. But analysts from Goldman Sachs recently said they could see U.S. oil prices climbing to $100 per barrel by the third quarter of this year if demand picks up. Goldman does not think the market is prepared for an increase in demand because the global oil supply hasn't been growing.

I don't know if oil moving to $100 is enough to completely stop the market, but there are others that think the price of oil is going to climb to higher levels that the market is not preparing for.

Given the way Berkshire has been buying Occidental and Chevron, I would guess it is preparing for a potential situation like this at some point down the line. Higher oil prices tend to increase prices everywhere else and lead to high inflation. This would likely be bad for the market, and could send investors back to stocks like Berkshire Hathaway.

More of a defensive play

I do think Berkshire could have a good year if inflation subsides because it does own many stocks and operates many businesses that would benefit from slowing inflation and the end of rate hikes by the Fed.

But I also believe that Berkshire is positioned to play defense in a tougher economy, as well as in a scenario where oil prices rise to levels not currently expected by the market. If a scenario like this plays out this year, then I think Berkshire turns it around and ends up beating the market.

In a more favorable environment for stocks, I'd give the market a slight edge over Berkshire stock, largely because it is coming off such a tough year and many valuations are now at more appropriate levels.