Active noise cancelling (ANC) headphones use sophisticated algorithms to analyse surrounding noise and create an opposite sound wave to cancel out unwanted noise, while passive noise cancelling headphones use physical barriers like padded ear cups to block out external noise.