There are a couple of things that cause a bullet to be stable over the entire trajectory.  If it is a hunting bullet, there are a couple more things that determines whether penetration is as straight and deep as possible.

Twist rate, shape of the bullet, speed of the bullet at a given time and shape of the afterbody of the bullet all plays a role in whether the bullet is stable. -

Twist rate and bullet length normally go together and the longer a bullet is, the shorter is the twist rate that the bullet requires.  It is possible for a shorter bullet (but a different shape) to require the same twist rate as a longer bullet and vice versa.

Stability is measured in Sg (gyroscopic stability) or Sd (dynamic stability).  The latter should not to be confused with SD (Sectional Density):

Dynamic stablity could cause a bullet to be unstable if the launching velocity is too high.

A bullet can be stable or unstable, it cannot be 'more stable' or 'less stable':

The Sg can be higher or lower but, if the Sg is below one, the bullet is unstable.