I am a newbie but as far as I understand that there are two sources of time dialations, one due to relativistic speeds and the other is due to gravitational field. If I look at these equations they do look pretty similar and if you solve it for v then you get the escape velocity, which seems not random.
So, you need to match the exact time dilation of earth’s gravitional pull to escape from it.
So, my question is this the cause of escape velocity or something magically occur?