A fundamental of welding distortion is...
Weld metal shrinks!
As Weld metal solidifies and cools, it shrinks.
It shrinks in all directions but seems to shrink more in the direction of travel.
And that causes welding distortion.
Have you ever laced up your work boots and had to redo them because they were too tight?
The accumulation of stress from each lace adds up.
Same with a welding bead.
As the weld bead progresses along, metal is constantly cooling and shrinking.
Sometimes, distortion can be overcome just because the part is fairly rigid as is the case when you weld a small rectangular frame out of square tubing.
But when the part is not rigid and allowed to move around, weld sequence and direction of welding becomes more important.
Roy Crumrine shows how he uses weld sequence and direction of weld travel to make a 90 degree weld joint end up at 90 degrees.
He starts by tack welding on the outside corner.
Then pulls the joint out of square by about 1/16" (1.6mm) to the outside. Remember, its easy to draw a weld in the direction of the throat..but very difficult to draw it the other way.
So by pre-placing the joint a few degrees out of square and making the first weld toward the outside corner, the final weld comes out square.
And if it doesn't quite wind up square a little speed cooling with an air nozzle, or using a can of dust buster spray does the trick.