How market ecology explains market malfunction