I don't know why but I know it works. I live in Texas and I kept seeing these bags of water hanging on the patios of Mexican Restaurants. And when I visited Mexico they would put water in jugs and set them around the outside eating areas every two feet or so. One year I had really bad flies so I went to the high end grocery store with the good, clear produce bags. I filled them with water and hung them with string so they were about three to six feet off the ground. Huge improvement. Also good to put a couple around the door to your house, fewer of them get in. How this works is a long standing debate and there are all kinds of theories.
Hope that helps!