In psychology it's called behavior modification, positive reinforcement
It's how they train dogs, after a while they figure out what behavior gets a dog treat That's Pavlov's experiments or BF Skinners behaviorism.
In philosophy, Aristotle's virtue ethics required practice. Repetition. Aristotle's ethics included the golden mean. To go to the mean required avoiding extremes. You needed practice to find where that mean was.
Like firearms or archery competition, you are little off to the right of the bulls eye, so you aim a little more to the left You're off again, so you move the sights a little to the right. You have to zero or calibrate the scopes to narrow it down.
Exercis is the no pain no gain theory. You need repetition to build up muscles.
same with the brain, use it or lose it.
same with math or any other brain, mental activity.
the horse knows the way. if the horse goes along the same trail enough, it knows where to go.
you drive somewhere, soon it's mechanical. without thinking you make the same turns to get where you're going.
habits are formed in about 4 weeks. at first it's frustrating or requires effort to get a good habit. soon it's a habit, habitual, done without thinking or effort.
Employers look for experienced employees. they require less supervision or training. They'd done the job repetititely already. No on the job training needed. Experienced employees are experienced because of repetititve work.
repetition creates an intuitive reflex. a math problem may require 10 different steps. If you've done similar problems enough, you start to instantly know several of the steps, then you can focus on what remains using less time overall to solve the problem.
move to a new city, at first you're lost. you need a map or have to ask directions or figure out how to know what your gps is saying. then after repeatedly going the same route, you know where to turn, and you don't get lost (as much, as often)
you talk to someone, at first you blurt out things that are annoying to them. then you slowly figure out, after repeated encounters, what works and what doesn't work. what their eccentricities are. what they're tastes, preferences, foibles, fears, pet peeves are.
Mistakes are avoided through repetition. At first some routine mistakes happen, but then you beging to anticipate the problems and avoid the same or similar mistakes.