TW this is a great question and subject, and as you see a lot of variables come into play. I'll try to make some parallels that make sense.
1) Barrels swell and vibrate when a bullet is passing through it, .22 rimfire and up. Imagine the barrel as a diving board. Depending on the weight and speed of the diver jumping on it, it will flex a lot or a little. A stiffer diving board takes more energy to flex, this is why we like stiff barrels. If there were something under the diving board that it touched during the flex, that would influence it as well, a light load might not make it come into contact with the object, but a heavier one would. This is why we like free floating barrels. If you put something under the diving board that touches it from the beginning, it is going to influence it a lot, change the characteristics of the board completely. Like a bipod on the barrel or resting the barrel on anything, sand bag, fencepost etc...
2) Frequency and amplititude. And why it matters.
Frequency is how many times something happens over a specific amount of time, amplitude is how far it moves in this context. Take the diving board example again, you flex the board and it goes up and down during and after the load has been delivered, it will continue to go up and down until is settles. How many times it went from center, to up and down, is the frequency, how far it moved, up and down is the amplitude.
Now imagine your barrel as the diving board, as the bullet go's through the barrel, the end of the barrel is beginning to whip, depending on the frequency, the bullet may exit one time on the up cycle and the next on the down cycle, there fore the bullet will vertical string the shots. Depending on the amplitude, the distance the muzzle moves during the cycle and when the bullet exits, can make more distance between the shots on paper.
Skinnier barrels move more, thicker barrels move less.
Thicker barrels are more resistant to movement from outside sources, like touching the stock or a bipod, or resting on a fence post, but it still makes a difference. Just less of one.
Fine tuning your loads, can reduce the frequency and amplitude, the idea is to have bullet exit as close to the beginning static position of the muzzle as possible, therefore less dispersion.
Out side influences like the stock touching the sides of the barrel or loose stock screws cause the horizontal or all over the place groups, especially as the barrel gets hot, cold metal is stiffer than hot metal, not uncommon for a skinny barrel hunting rifle to shoot the 1st 3 shots very well, and then open up quite a bit.
Hope I satisfied ya - HAZ