When investors see uncertainty in the economy and market, they have a typical playbook... They rush to safe havens. This usually includes bonds, gold, and utility and consumer-staples stocks.
Folks want to be in utilities because many of these stocks (typically companies supplying electricity, gas, or water) are highly regulated natural monopolies... and their underlying businesses aren't impacted much by an economic downturn.