What is the purpose of quenching?

What is the purpose of quenching?

1) Improve the mechanical properties of metal products or parts. For example: improve the hardness and wear resistance of tools, bearings, etc., increase the elastic limit of springs, and improve the comprehensive mechanical properties of shaft parts.
2) Improve the material properties or chemical properties of some special steels. Such as improving the corrosion resistance of stainless steel and increasing the permanent magnetism of magnetic steel.