Traditionally, the bowsprit is fixed - meaning the connection point for the sail is also fixed. When you let the mainsheet out, the bottom of the sail has to pivot out from the end of the bowsprit.

The yard is connected to the mast, as well as to the luff (front edge of the sail) so it pivots too, only not as much. This changes the sail geometry. A sail is not stretchy, so as the clew (low, back corner of the sail) moves out, it also moves up, making the sail more horizontal. The pivoting at the front of the sail also goobers up the wing shape of the sail.

Actually, this is touted as one of the 'features' of a dipping lug - it acts as a Lifting Sail - meaning it actually helps pull the boat up out of the water.

Note: I just estimated how much the yard would rotate at the different points of sail. I don't know how much it will twist, I just know that it will twist.