Note: Do not rely on this information. It is very old.
NN, the fourteenth letter of the alphabet, corresponding to the Phoenician nun ("fish"), was derived from the hieroglyphic sign for water. It is the nasal dental, holding the same relation to d and t, that m does to b and p. Hence d was often generated after n, as in thunder (Anglo-Saxon thunor). The "parasitic" letter which thus arose through careless pronunciation belonged to the palatal class if a palatal letter followed, to the guttural if it came before a guttural (e.g. sing-ging for sin-ging). In some words the n itself is parasitic, e.g. messenger for messager. M and n interchange before labials and dentals, e.g. comfort from Latin confortare; count from Latin comitem.