A polyp trap is a specimen collection device used during colonoscopy and other endoscopic procedures to safely capture and retrieve removed polyps for laboratory analysis. It is typically connected to the suction system and filters the specimen from aspirated fluid, ensuring proper preservation and identification for histopathological examination.