Not an expert, but here is my understanding: Elliptical galaxies are typically quiescent (and spiral galaxies aren’t). The “massive” quiescent galaxies observed in the early universe are however smaller than the “giant” elliptical galaxies observed in the more recent universe. It is assumed that the latter evolved from the former, most likely by merging with other galaxies. This question of how exactly they evolve(d) is the subject of continued research.
More generally, see also https://en.wikipedia.org/wiki/Galaxy_formation_and_evolution.