Exchange-traded funds have amassed trillions of dollars by offering investors greater tax efficiency, liquidity and lower costs than mutual funds.