well PID is used with a feedback system. e.g. you have a drone flying and need it to keep in level. here gyro and accelerometer will provide the feedback signal to PID. now your drone right side down. ideally sensors should output all zeros in level condition but this tilt will produce an error and that error from the ideal value is them amplified by PID and a correcting signal is calculated. this signal is added to the motors power and drone came back to level position.
these corrections are so fast and accurate that drone oscillations are minimized and it becomes stable.
in a ordinary drone PID applies corrections 250 times in a second. same can be used in a two wheel robot. there you only need one axis