How does a drone measure height?

It’s a MEMS device. They are tiny! A diaphragm on an IC that acts as a capacitor, and its capacitive properties change as atmospheric pressure changes.

The spec sheet of one I found claims it can measure the pressure change writhing. 9cm column of air.

They’re small enough, Apple Watch uses one to count how many flights of stairs climbed, or height climbed when hiking.