Modern drones have built-in GPS, which includes being able to locate them in altitude. Even “consumer-level” (albeit very expensive) drones can come with advanced GPS modules that are accurate down to like, the centimeter or something ridiculous like that.
The drones aren’t programed to maintain *relative* location, they’re just programed to be in an absolute GPS location, with some margin of error, and *assume* that they’re all where they’re supposed to be. If they *aren’t* where they’re supposed to be, hopefully they’re withing the margin of error and won’t collide or interfere with each other. Really, that’s quite rare – modern drones are *smart* and the GPS is good. Not infallible, but good.
Latest Answers