Tom Statler, Lucy program scientist, told VOA in an email that Trojan asteroids are "leftovers from the formation of our solar system's giant planets — Jupiter, Saturn, Uranus, and Neptune" and that "the formation and early evolution of the Earth was influenced by what was happening to the giant planets farther from the sun.
Source: tatoeba (10366979)