Why does different ammo of the same calibre & same grain shoot
higher or lower?
If there is a significant difference in the velocity of the same size and weight bullet, there will be a difference in the point of impact.
If there is no significant difference in the velocity and you get a difference in the point of impact the reason becomes more ...elusive.
IF, for example, you have 158gr .38 special from maker A and B and both list the same muzzle velocity, but one shoots higher then the other from your gun, the cause is more difficult to determine, and may eventually boil down to "that's where your gun wants to put them". (and that's not sarcasm, even though it sounds like it)
It is always a number of factors acting together in just the right way to produce the results you get. Change one thing, just a little, and you may not see any difference. OR you might, it all depends on "how the stars line up".
Engineer types call it "stacking tolerances" or "Stacking variables" What it means is every single variable in the ammo gun and shooter combination act together in a certain way, and when that way is repeatable and consistent, we call it accuracy.
The most common reason for the same weight bullet to hit higher or lower than another brand of the same weight is a difference in speed, but WHY there is a difference in speed can differ. Powder amout / type is usually what is looked at, and is often the culprit, but its not the only possible reason.
Bullet fit to barrel bore, bullet construction (the actual alloys used) these are a couple of points not usually looked at but possibly the reason.
A "fatter" bullet (by a very small amount) creates a different amount of friction in the barrel than a "thinner" one. Also a harder bullet has a different amount of "drag" in the rifling than a softer one.
Things like this can cause velocity differences, even when fired using the most rigorously controlled identical powder charges. IT can get complicated.
Barrels vibrate kind of line tuning forks as the bullet moves through them. The muzzle moves up and down due to this (not visible to the naked eye) If the ammo from maker A times it so the bullet exits the muzzle when its on the "up" end of its swing, and ammo from maker B is just enough different in your barrel so the bullet exits on the "down" end of the muzzle whip, the bullets will go to slightly different places, even if the measured muzzle velocity is approximately the same.
Hope this helps!