The trap is pre-baited with synthetic insect pheromones. Pheromones are chemicals insects excrete to communicate with their own kind.
Insects leave behind trails of pheromones for their own kind to follow. Insects predators often use these pheromone trails to track down insects. House Lizards, being an insect predator, will be lured by the scent and get itself stuck in the pool of slow-curing glue.