Lactams are cyclic amides formed from molecules that contain carboxylic and amine groups. The reaction is carried out by heating in the absence of acid.

 
lactam-synthesis
 
The formation of lactams has the following mechanism:
 
Stage 1. Addition of the amino group to the carboxylic acid.
 
lactam-synthesis
 
Stage 2. Acid-base balance
 
lactam-synthesis
 
Stage 3. Water removal
 
lactam-synthesis