In Star Trek (2009), Spock is captured by Romulans and abandoned on a planet (or moon, seemingly) near Vulcan, from which he later watches
the destruction of his home world.
The timing is unclear but it seems he has been there for some time and established residence in a cave, knowledge of local life-forms, etc. He also knows that there is a Federation outpost nearby (I think they said 15km or 20km,
he is later able to walk it with young Kirk).
Why does he hang out in his cave in the first place? Why not return to the Federation from the start?