Not an expert, but I think it’s done very simple by uploading map coordinates and elevation into flight computer. By knowing exact coordinate of the aircraft prior to takeoff, computer calculates speed, angle, direction and how much time the aircraft has traveled… thus giving you constant location of the aircraft. Again, don’t quote me on this… I’ve either made this up or read about it long time ago…