In order to enhance the quality of thread processing by tap, a systematic analysis of its forming mechanism and factors affecting forming quality is conducted. Effects of the number of edges, the amount of shovel back, the extrusion cone, the calibration part and the extrusion cone angle on the torque and temperature are achieved by finite element analysis and experiments. From the perspective of reducing torque and temperature during the forming process, the optimal combination of tap structural parameters for machining M22×2 internal threads on 42CrMo4 high-strength steel are further obtained through orthogonal optimization. The results show that, unlike the cutting process of threads, the extrusion forming process of threads is a net forming process in which metal undergoes plastic deformation in a limited space, and the metal material continuously flows along the edge of the V-shaped groove of the tap, gradually piling up to form the thread tooth shape. This also caused a noticeable lack of flesh at the top of the extruded thread teeth. Better quality threads can be obtained by machining with optimized structural parameters. The maximum torque and temperature during the machining process are reduced by 22.86% and 20.31%, respectively. The depth of the hardened layer increased by 0.05 mm, and the root and top hardness of the teeth increased by 10 HV0.2 and 5 HV0.2, respectively.