Thats another good question. Does the Mavic judge its speed as ground speed or true airspeed? I believe that the Mavic uses ground speed as its speedometer, because that will actually measure its RTH progress in position and distance instead of angle of attack. Also, by measuring RTH progress by distance traveled, it can more accurately measure if it will be able to make it back based on the amount of battery it has left. If it is only able to maintain position, even though the motors are spinning at max RPM to try and get it back, the RTH low battery indicator will tell you that it is RTH automatically, even though it will never make it back. It will simply stay in the position, fighting the wind, until it runs out of battery, gets to critical, and lands.
The Mavics internal flight computer is a very complex calculator, takes into account many variables, and can mostly be trusted. In heavy winds, it cant, and I never trust it to accurately measure how much battery I have left. I always lean towards conservatism, and try to land with 40% battery, just in case. Yes, thats a little extreme, but in thousands of flight, I have only had to force land a few times due to low battery, when the winds aloft were greater than expected during an oncoming storm.