N-Nitrosamines, including the carcinogenic variety, arise from the reaction of nitrite sources with amino compounds, which can happen during the curing of meat. Typically, this reaction occurs when the nucleophilic nitrogen of a secondary amine attacks the nitrogen of the electrophilic nitrosonium ion: 
:NO + 2 H → NO + HO
:RNH + NO → RN-NO + H
Formation of an N-nitrosamine:
The nitrosamine can then lose water through protonation to form diazonium cation, which is a very useful intermediate to form different compounds.