The story
According to French and German mythology, the nymph Ondine/Undine discovered that her husband had committed adultery. Because he had promised his every waking breath to her, she cursed him that so long as he was awake he could breathe, but if he ever fell asleep he would stop breathing and die.
Etymology from Wiktionary, CC BY-SA 4.0.