You've almost got it. Part of it at least. Barrels (like any object) have multiple resonant frequencies. how they vibrate depends on the frequency (frequencies, really) of the driving force. In very simple systems it's possible to excite only one "mode" or resonant frequency. In real world systems, many get excited at the same time. So you wind up with a complex dynamic motion of the muzzle. It's moving and deforming in 6 degrees of freedom - sideways, back to front, up and down, plus the three axes of rotation (roll, pitch, yaw). The precise orientation and motion of the muzzle as the bullet leaves determines the initial conditions for the bullets path.
Different charges will produce different velocities and drive the barrel vibration slightly differently (because it changes the driving force). When put all together, you can have the vibration cancel out the velocity variation. One of the predominant driving forces in a rifle is the imbalance in support and mass distribution in the vertical plane. Because of that, you get a large up/down component to the muzzle motion. That's why positive compensation is so easy to see relative to other barrel motion effects. It's not possible to calculate this motion precisely enough to be useful. Measuring it is extremely difficult and impractical. But we can see the effects on the target.
It's important to note that this is not all there is to what makes a load good. It's my belief/opinion that there is simply a great deal we do not understand. Some things we do, but we probably don't know more than we do. Some things we kind of understand but not well enough to be truly useful.
At the end of the day, we're rapidly approaching academics at this point. That's fine and I personally enjoy it for its own sake, but you don't need to understand how something works if you just want to print small groups. Knowing that it works is enough.