The urea cycle is a metabolic pathway that occurs in the liver to convert excess nitrogen from amino acid catabolism into urea for excretion. It involves five enzymes and five steps to synthesize urea from ammonia and carbon dioxide. Defects in the urea cycle can cause hyperammonemia, where high ammonia levels impair the citric acid cycle and ATP production in the brain.