His wife's contribution
One account of the piece's genesis is that after a tiring day of teaching in 1898, Elgar was daydreaming at the piano. A melody he played caught the attention of his wife Alice, who liked it and asked him to repeat it for her. So, to entertain Alice, he began to improvise variations on this melody, each one either a musical portrait of one of their friends, or in the musical style they might have used. Elgar eventually expanded and orchestrated these improvisations into the Enigma Variations.