Why are moths drawn to light?

–Ian McEwan (2001) answers:

[I]t was the visual impression of an even deeper darkness beyond the light that drew them in. Even though they might be eaten, they had to obey the instinct that made them seek out the darkest place, on the far side of the light – and in this case it was an illusion.

And Estella says in Great Expectations: “Moths, and all sorts of ugly creatures hover about a lighted candle. Can the candle help it?”