There was a science-fiction story or book where an alien lands on one of the moons of Saturn or Jupiter with its damaged spaceship. The alien is extremely intelligent, powerful and has a long, long lifespan. It’s able to search our solar system and notices our planet at a time when Homo Sapiens have just arrived on the scene.
The alien then uses his power to guide humans (unwittingly) through their history over the millions of years ultimately to the point where they acquire space travel and can make a visit to the moon that the alien is on with its damaged ship. The sole purpose of all this - and of all human history- is to allow the alien to eventually get and take a piece of circuitry from the earth-ship and use it in the alien’s ship for repairs that will allow the alien to continue on its journey.
My first thought was that this was a story from Kurt Vonnegut but that’s the only lead I have and I could be wrong. I would say the book or story was written somewhere in the 60’s, the 70s or 80s.