It works by the attraction of food and other flies to breed with. Some will fly back out but most will stay in and die. If you leave it out long enough they will breed and soon it will be full of maggots. It is one of the most disgusting things you will ever smell but they do work very well. Woodstream makes a version of the same thing that uses pheromones to attract the flies. Gross but very effective!