You snapped, or reached for the phone, or said yes again, and afterwards it reads as a choice: a decision taken badly, to be taken better next time with a little more will.
Watch one of those moments closely, though, and the order is the other way round. The reaction has usually finished before the choosing starts, and what feels like deciding is often noticing, a beat late, what the mind already did. Yoga philosophy has two words for why, and between them they say where a pattern comes from and where the work on it actually is.
A mental impression (Samskara) is the groove left by a past experience, the reason a reaction can feel automatic before you have chosen it. Every time you run a pattern, the groove deepens. Practice works directly with samskaras: not by force, but by laying down new, cleaner grooves until the old ones quieten.
A deep tendency (Vasana) runs deeper still: the accumulated shape of character, the inherited flavour of how a particular mind tends to move. Many samskaras of a kind settle into a vasana.
Together they are why change is slow but real. You are not fighting a single thought; you are re-grooving a riverbed. The law that carries these grooves forward is Karma; the habit mechanism in practical, daily form lives at sense withdrawal (Pratyahara).