Unraveling the Mystery: How Do AI Detectors Work?