New research may have discovered the answer to the age-old puzzle of why moths and other insects are attracted to lights.