What happened

Shares of oil stocks dropped across the board on Friday, with upstream shale driller Devon Energy (DVN -0.89%), refining and midstream giant Phillips 66 (PSX -0.66%), and oil services provider Core Laboratories (CLB) all falling sharply, down 5.4%, 4.3%, and 9.1%, respectively, as of 1:38 p.m. EDT.

While each of these companies operates in a different corner of the oil and gas industry, all are sensitive to end demand for oil and refined products. Today, crude oil prices were down nearly 4% as of this writing.

Devon reported fourth-quarter earnings earlier this week, but those figures were likely already incorporated into Devon's valuation. Instead, these oil-related stocks fell with oil prices today, likely due to two factors, one having to do with the Federal Reserve and the outlook for the general economy and another having to do with a large inventory build in the U.S. this week.

So what

This week, oil investors got two inventory estimates that came in higher than expected. On Tuesday, the American Petroleum Institute estimated that the U.S. saw a big inventory build of over 10 million barrels of oil for the week ending February 10. Then on Wednesday, the U.S. Energy Information Administration revealed an even larger 16.3-million-barrel inventory build in the U.S. for the same week. The larger-than-expected build follows on a number of recent weekly ones, which has resulted in U.S. crude inventories now being above the five-year seasonal average.

Higher-than-expected inventories could point to weaker demand than expected. That would be especially surprising in light of positive retail sales and otherwise strong economic figures in the U.S. in recent days. Therefore, the price of oil fell on the news.

Oil prices didn't get any more help on Thursday, when the Producer Price Index (PPI) for January came in at 0.7% month over month, much higher than the 0.4% expected. That report combined with Tuesday's slightly higher-than-expected Consumer Price Index (CPI) data to renew fears the Federal Reserve would hike interest rates higher and for a longer period of time.

Higher interest rates tend to raise the value of the dollar versus other currencies, and because oil is priced in dollars, higher rates tend to depress oil prices. In addition, hotter inflation might be fueling fears of a "harder" landing or recession down the line, which has the potential to lower demand.

Now what

Oil and gas stocks greatly outperformed the slumping market last year but have lagged this year. The Federal Reserve's interest rate hikes might be taking their toll on demand, but inflationary pressures are still present. As Devon noted on its earnings call earlier this week, even the oil drillers and service providers themselves are dealing with inflationary cost pressures. When those are added to lower oil and gas prices, that is not a great combination for earnings results.

Still, oil and gas stocks should make up at least a small portion of investor portfolios. As last year showed, geopolitical events have the potential to cause energy price shocks at any given time, so stocks levered to the oil and gas industry act as something of a hedge against that scenario. Furthermore, while earnings may be down, these companies tend to pay out handsome dividends and repurchase their stocks while generally trading at cheap valuations.

One could just as easily imagine a scenario in which oil and gas prices take off again. China's economy is just reopening from its 2022 lockdowns, which should fuel increasing demand. Summer is also the high-demand "driving season" in the U.S. Finally, with the war in Ukraine still an unpredictable factor, it's probably a good idea to keep a small allocation to traditional energy stocks and rebalance around it accordingly.