After oil prices soared and inflation hit technology companies, Saudi Aramco surpassed the tech giant Apple as the world's most valuable firm.

On Wednesday, Aramco traded near its all-time high, with a market capitalization of almost $2.4 trillion (£1.9 trillion), surpassing Apple for the first time since 2020.

In New York, the iPhone manufacturer slumped 4.4% to $147.53, valuing the company at $2.3 trillion.

Even if the shift is temporary and Apple reclaims the top rank, the role reversal highlights the power of key forces at work in the global economy.

While rising oil prices are good for Aramco's revenues, they are worsening rising inflation, causing the Federal Reserve to boost interest rates at the quickest rate in decades.

As interest rates rise, investors are less likely to invest in technology equities, as future earnings are predicted to be impacted by inflation.

"You can't compare Apple to Saudi Aramco in regards to their enterprises or characteristics," said James Meyer, chief investment officer at Tower Bridge Advisors.

"However, the prognosis for the commodity market has changed. They're the ones who benefit from this inflation and scarcity," he said.

The tech giant Apple had a market worth of $3 trillion earlier this year, about $1 trillion higher than Aramco. Apple, on the other hand, has lost 19% since then, while Aramco has gained 27%.

A request for comment from Apple was not immediately returned.

According to Tim Ghriskey, senior portfolio manager at Ingalls & Snyder, it may be a while before tech regains dominant position, with the Fed on track to hike rates by at least another 150 basis points this year and no signs of a resolution to the Ukraine war.

He added that there's panic trading in many IT and other high-multiple companies and the money pouring out of there seems to be going in, particularly for energy, which, given commodity prices, has a favorable view for now.

Companies like Aramco stand to gain a lot from this kind of environment. Concerns about inflation and a much more assertive Fed have weighed on technology stocks this year.

Apple's recent results also highlighted the challenges it faces due to supply restrictions. Given its consistent growth and solid results, which have restricted its loss this year, the stock is still considered a comparative safety choice within the industry.

The stock's year-to-date slump is less than the Nasdaq 100 Index's 24.8% drop.