Why do moths fly towards the light?

What purpose does it give and how did they actually evolve to like light? And why do they keep flying into it everytime?!!
3 answers 3