The Time Trapper created a pocket universe and altered events in that pocked universe so it would resemble Pre-Crisis Earth-One, he even created it’s own Superboy who was somewhat close to Pre-Crisis levels (could fly FTL, break the time barrier, etc). The Time Trapper then further manipulated the timestream so that whenever the Legion would travel into the past to visit the 20th century (or Superboy visited the Legion's future), the two would be directed into each other's worlds.
All of this explained in detail in the Pocket Universe Saga which consists of the comics:
Legion of Super-Heroes v3 37
Superman v2 008
Action Comics 591
Legion of Super-Heroes v3 38
All of which I will post shortly.