how is an earthquakes depth related to the distance from an ocean trench?

how is an earthquakes depth related to the distance from an ocean trench?