The correct response regarding how an insect trap works is: It attracts specific insects by its smell.
Many insect traps are designed to target specific types of insects using lures, like pheromones or food scents, that draw them in, making them easier to capture or kill.