It allows them to apply more torque to the bolt. Torque is the turning or twisting force that causes rotation, in this case, it's applied to the bolt in an effort to loosen it. By lengthening the handle of the wrench, the mechanic is able to leverage more of their body weight and strength behind the wrench, increasing the torque they are able to apply to the bolt.
When a bolt is very tight, it can be difficult to turn it with a standard wrench. The increased torque provided by the longer handle allows the mechanic to apply more force to the bolt, which can help to loosen it. This can be particularly useful in situations where the bolt is corroded, rusted, or otherwise stuck due to a buildup of debris or other factors.