There's one hypothesis that IMHO makes the most sense (it's one of several that have already been mentioned). On the other hand, making sense is not necessarily a prerequisite for accuracy in the Star Wars universe.
That hypothesis is that some unknown alien species, for some unknown reasons, brought humans from Earth to Coruscant in the distant past, where they built a civilization and spread out to the rest of the Star Wars galaxy.
In our reality, there is ample evidence that humans evolved independently here on Earth. There's been plenty of fiction that has humans being introduced on Earth from elsewhere, but that doesn't fit in with the known fossil record and our genetic similarity to all the other species on Earth.
In the Star Wars universe, the origin of humans is unknown. The most widely accepted theory is that they evolved on Coruscant and spread out from there, but that's difficult to verify; Coruscant is so over-built that archaeology is impractical.
According to this timeline, Coruscant was completely covered by its principal city 100,000 years before the events of Episode IV. Anatomically modern humans appeared about 200,000 years ago. That leaves 100,000 years to be split between (a) time for the human colonists on Coruscant to build their planet-covering city, and (b) time to account for the "a long time ago" in the opening credits.
Humans on Coruscant developed an interstellar civilization much more quickly than Earth humans have, but that could be explained by the influence of whoever brought them to Coruscant.
This assumes that "a long time ago" is relative to our current time. If instead it's relative to the time of the story's hidden narrator, we have a lot more flexibility. Future Earth humans could develop interstellar, and then intergalactic travel, and establish a colony on Coruscant without outside help. Some disaster could then cause them to lose their historical records; as they recover, they build a new interstellar civilization, the one that we see in the movies.
Pulling some numbers out of the air, we could have:
- 1977: Humans on Earth watching science fiction movies.
- 2200: Humans have developed interstellar and intergalactic travel.
- 2500: Humans colonize a planet that will later be called Coruscant.
- 3000: Human civilization on Coruscant goes through a crisis that results in a loss of historical knowledge.
- 10,000: Human civilization on Coruscant has recovered and built a single dense city covering the entire planet.
- 110,000: Battle of Yavin
- 200,000: The civilization that (re)started on Coruscant has now spread to other galaxies. Someone produces an epic historical drama about the events that happened 90,000 years previously, "a long time ago in a galaxy far, far away".
- 200,100: The script for this drama falls first into a black hole, then into the hands of George Lucas on 20th century Earth.
- 201,977: Contact with Earth is re-established. Descendants of Coruscant humans see the original Star Wars. The temporal paradox causes the Universe to vanish in a puff of logic.
Note that some of this is just a little bit speculative.