It normally stays level. So, for example, if you launch at a higher location, and go into a valley, you should reduce your height to remain a max of 400 ft above the valley floor.
There are situations - terrain follow mode and return to home with obstacle avoidance - where the mavic will respond to terrain objects and go higher automatically, but it will never go lower.