Here’s a great picture of exactly how we achieve our goals through repeated actions. We become what we repeatedly do.
This is a time-lapse of a Japanese group that walked the same path over and over. After several days they had worn a path in the grass. Consider how long it will take for the path to grow over once they stop walking. Weeks? Months? Once the path is sufficiently well-trodden, it will remain for a long, long time. As you are cultivating new habits, frequent repetition is the key to changing an action into a habit.
In the same way weaning yourself from a bad habit is not an overnight proposition. It will take time and effort to keep yourself from travelling the well-worn path long enough for it to grow over and disappear.
The lesson also applies to creating memories, although this illustration would represent brute-force repetition. Easier: use mnemonics to create a stronger path initially. That will cut down on the number of repetitions you’ll need to make that memory rock solid.