Muscle memory can best be described as a type of movement with which the muscles become familiar over time.
For example, tying your shoes or typing on a keyboard. There was a time that you couldn't do either of these. But someone showed you the proper way to do them and you did them so many times that now you do them without even thinking. You don't have to tell your muscles to tie your shoes or your fingers to type. Your muscles pretty much do it for you.
When you learn a new activity and practice it, your brain is active. It will "remember" the movement. You will not have to "tell" your body to swing a bat properly, it will just do it.
It becomes an un-conscious process. Your muscles become accustomed to the movements. The more you practice a movement correctly, the better your chances of doing it correctly during live action. If you have practiced the proper mechanics of the baseball swing many, many times, you won't have to tell yourself to "stay back" in a real game, your body will just do it.
Make sure before you start practicing to build muscle memory, that you learn the proper technique. If you practice improper technique, your brain and muscles will remember it and re-produce it during a game. That's why it is sometimes easier to teach a young, in-experienced baseball player than it is a player who has been "doing it wrong" for years. They must work harder and practice more to "un-learn" the bad habits.
So, the subconscious mind controls your muscle memory. When an action is practiced over and over and over again, we can repeat that action without thinking about it. As long as you allow your subconscious to control you, it will direct the muscles and body to respond.
Where the trouble starts is when, during game situations, you get nervous or tense. You squeeze that bat tighter, which restricts the muscles from performing as trained. Relax and trust your body to respond. If you have practiced the proper baseball swing mechanics enough times, it will respond.
I don't know what the number of times is to produce muscle memory. I can tell you that the more repetitions you do, the better and faster your muscles and body will respond.
You can "prime" your muscle memory while waiting "on deck". Just for a second or two, close your eyes and visualize yourself swinging properly. Take a few deep breaths to relax. Again with eyes closed, swing your bat and see the proper swing in your mind. Trust your body to respond. It will.
Return From Muscle Memory To Baseball Hitting Drills