HCAs are primarily formed through the thermal processing of meat. The heat causes the amino acids and creatinine in muscle meats to react, leading to the formation of HCAs. The formation of these compounds is influenced by factors such as cooking temperature, cooking duration, and the method of cooking.