Muscle memory is what keeps your races the same every time. Michael Phelps knows what hand he’ll end on and how many strokes every lap is because of muscle memory. Your brain functions much the same. Studies have shown that chewing a certain flavor of gum when studying, and then chewing the same flavor during the test will help you remember your notes better than usual.
Swimming is much the same. Your routine before each race should be almost identical if at all possible to get your muscles in the mode of remembering what they are supposed to do. If you throw your pencil on the desk in the same spot every day of the year and then someone moves the desk, your probably going to miss the desk and hit the old spot your first day. Races are the same, if you listen to a certain song and stretch for ten minutes before every race for a year, and you don’t do it one race, that race will probably be off because your muscles are used to music and stretching before the race. Your mental preparation affects muscle memory.
Muscle memory is a key part of every race. You’ve swam the one hundred fly billions of times. Your muscles know what to do, so to get your body ready you have to connect your mind to a certain action before your race that you do every single race so your muscles will know that theres a race, they need to do it again.