Original: Any device capable of playing back recorded sounds can potentially be used as a red box.
Simplified: It works by playing back the same sounds that the payphone sends to the phone company when coins are put into it.