Flying is all about air pressure.
As far as the mavic barometer is concerned, it probably was spot on on it's pressure altitude all the time.
While flying low you create a vortex of faster moving air between the quad and the ground, thus the pressure drops, making the barometer read a different pressure, causing the flight controller to adjust the altitude so that the pressure reads the same. Lower pressure causes it to think it's ascending, higher pressure means it's descending.
edit: there's also something like a pressure bubble that changes shape and location based on the pitch of the craft, causing it to drop a foot or so when you change pitch and start to fly fast.
Simple. Every multirotor, even an Inspire 1, 2 or M600 will do this. Basic principles of flight every 'pilot' should know.