Food and energy prices surged to near historic highs in recent years amid the pandemic and the war in Ukraine, which prompted major supply disruptions.