Companies that sell basic goods and broad consumer staples sector ETFs are pushing higher as investors hedge their equity bets with a more defensive play.

The Consumer Staples Select SPDR (NYSEArca: XLP), the largest ETF tracking the sector, increased 10.0% over the past three months while the S&P 500 gained 4.5%.

ETF investors have also jumped on this more defensive equity sector play, funneling close to $1.2 billion into XLP in the last three months.

Some analysts believe the group’s comeback is the reveals investors’ willingness to pay a premium for protection against unexpected pullbacks during a times of greater uncertainty, the Wall Street Journal reports.

Consumer Staples & Volatility

Investors typically shift into consumer staples during bouts of market volatility because of the sector’s relatively generous dividend payouts and the slow-and-steady nature of the consumer staples business – consumers usually continue purchase basic products that staples firms sell regardless of market or economic conditions. Consequently, investors view the staples sector as a relative haven in the equities market that may help somewhat insulate a portfolio from risks like rising interest rates and increasingly restrictive trade policies under the Trump administration.

“If you’re predisposed to being defensive, staples over the last three months have looked like [a]great value,” Art Hogan, chief market strategist at B. Riley FBR, told the WSJ.

Related: Consumer Staples ETFs Don’t Often Do This

Many have also been attracted to the the dividend payouts from the consumer staples segment, which have become increasingly attractive as yields on benchmark 10-year Treasury notes dipped from the May high. For instance, XLP also sports a 2.72% 12-month yield, which exceeded the S&P 500’s 1.8% dividend yield and the 10-year Treasury note’s 2.87% yield.

Additionally, along with the relatively attractive yields, consumer staples companies have also produced some growth prospects as they enjoyed the ride along with other companies during the strong earnings season.

For more information on the consumer sector, visit our consumer staples category.