Both ETFs and index funds track the market, but differences in costs, liquidity and access can shape your returns.