The clearest explanation the Doctor has so far offered is probably the one he gave to Wilf, while they were aboard the Vinvocci spaceship in "The End of Time" Part 2. The basic point is that, because of the time lock, nothing can get into the events of the Time War from outside it & nothing inside it can get out, except (as he said) something that was already there -- already connecting the inside with the outside -- when the time lock was put in place. (That was why, in "The Day of the Doctor", the Tenth Doctor was so surprised that he & the Eleventh Doctor were able to reach the "War Doctor".)
In "The End of Time", the drumbeat signal from Gallifrey that the Master heard in his head was "already there" when the time lock was put in place, which is why it could serve as a way through the time lock.
We've not been given any technical details of how the time lock works. We've also not been told on TV how it was put in place but "Don't Step on the Grass" (comic story), referring to "The Forgotten" (comic story), states that the time lock was established when the Doctor used the Great Key of Rassilon to activate the Moment.