Official comment
It will return home when the battery detects that it is at a the maximum distance away from the home point that it has power to get home with. The battery keeps track of a maximum range radius for which it has power to get home. Once it detects that the aircraft has exceeded that it will trigger a return to home event. This takes into account the time to descend from the current flight altitude.
From https://support.dronesmadeeasy.com/hc/en-us/articles/206104736-Flying-Multi-Battery-Missions
"Battery Power Triggered Return To Home
The smart batteries in the Phantom 3 and Inspire 1 drones know how much power it will take them to get home. When the aircraft realizes that it is further away than it has power to get home, it will immediately head for home and draw a Abandonment Point on the Map Pilot map.
We have tested this extensively and have had no problems with it. Remember that the aircraft's distance to home power requirement will likely be wrong in the case of a stiff headwind so keep that in mind. "
https://support.dronesmadeeasy.com/hc/en-us/community/posts/205629753-Phantom-4-Battery-Life