In season 5 of Doctor Who, the Doctor is sealed in the ultimate prison (the Pandorica). It can only be opened from the outside (one wonders why the Pandorica would be designed to be opened after being sealed at all, but I digress). The Doctor manages to escape by travelling to the past and leaving clues for his companions so that they can let him out so that he can travel to the past and leave clues for his companions so that they can let him out so that he can travel to the past and you can probably get the point I am trying to make now. How did the Doctor manage to get out of the Pandorica to set this infinite loop into motion?
This is a case of the writer paradox.
The events can only unfold because the events have already happened.
In these episodes, the Doctor clearly insists on the fact that they experienced a paradox, but leaves it at that. And even though he followed the paradox, he never created it.
On a meta level Events that are shown to us are only the most entertaining timeline/alternate reality. So every timeline where it is interesting to see this paradox happen, we see it.
Digression : That's why we follow the Curtis family in the movie 2012, because they are the one who makes it. Similarly, we only see the reality where the Doctor makes it (most of the time).
The Pandorica is a special case though Indeed, every reality where this paradox didn't happen has been destroyed. So the paradox must happen. So there is no other reality to show us.