In Avengers: Endgame,
it's explained that traveling back in time to change the past creates a new timeline for everyone and everything in that changed universe.
At one point in the past,
Thanos acquires the ability to time travel himself, and he uses it to travel into the future. But he uses it to travel into the future of the main timeline.
But why doesn't he just end up
in the future of his own universe? How does he get back into the main one from there?