Swinging leg

What does swinging your leg out to 3rd (for righties) do? I’ve seen goose gossage and bob gibson do it, but what does it do?

They did it to keep the front hip closed as well as promote leading with the front hip. It also helped open the front hip quicker because a straight sweeping front leg will engage more of the hip and butt muscles that open up the front leg. A lot of MLB pitchers do this.