Heat treatment involves heating and cooling metal to alter its physical and mechanical properties without changing its shape. It is used to increase strength, hardness, or ductility based on the alloy and application.