AR works by using cameras, sensors, and software to detect the real-world environment and then superimpose virtual elements that interact with physical objects in real time.