There is no difference, you have to use "e" in front of a word starting with a consonant, "ed" in front of a word starting with another "e", if the word start with a vowel that isn't "e" you can chose which one to use.
The same happens to the prepositions "a" and "ad" and can happens, on your choice, for the conjunction "o": "od".
The "d" is called 'euphonic d', its aim is to avoid two vowel sounds in sequence, and for the "e" and for the "a" (not for the "o") it also has an etymological meaning because they come respectively from the Latin words "et" and "ad".