After months of decline, the market rebounded with significant support from state-backed funds buying into exchange-traded funds.