In cold clouds between the stars, dust grains are coated with ice, like windows covered with frost in winter. On this icy crust, chemical reactions take place that do not occur in gas. One such reaction is the encounter between a carbon atom and a nitrogen molecule. In gas, they barely react, but on ice they combine immediately, without an energy barrier.
The resulting molecule CNN then picks up hydrogen atoms. It is like assembling a construction set: first attach two blocks, then add more. Eventually, the bond between the two nitrogen atoms breaks, and the chain rearranges into the N-C-N skeleton — the basis for cyanamide (NH2CN) and its isomer carbodiimide (HNCNH). Calculations showed that all steps proceed easily, with low barriers.
When these reactions were added to a model of protostellar evolution, it turned out that the icy pathway is the main supplier of these molecules. Carbon and hydrogen on cosmic dust do what had been unexplained for years.
Cyanamide is a simple compound, but on Earth it is used as a fertilizer and a raw material for pharmaceuticals, and in space it may have been one of the building blocks for prebiotic chemistry.
In Carl Sagan's novel Contact, the alien signal contains complex molecules — possibly including cyanamide born on ice.