Muscle memory is a great tool for a guitar player. You can practice a song or a solo slowly with a metronome, bit by bit, get it under your fingers speed it up and it’s there. Sometimes you don’t have to even think about what you’re playing, in what position you’re playing it etc.
Unfortunately, that’s not always a good thing, especially if you’re playing a piece that has many repetitions but also a lot of changes at the same time.
A B A B A B A B
A C A B A B A C
Your fingers would naturally would want to go to “B” every time you play an “A” and if you let them do it you’d be messing up in the 2nd row where “A” is followed by "C" not “B”.
So, your focus is almost as important as your muscle memory. Then again, if you’re too focused then you have the risk of sounding too timid and rigid. Stage fright may do that to you when all the strangers and your buddies seem to be watching you and waiting for that bum note, or at least when that’s what YOU think they’re doing.
Being relaxed enough to let your muscle memory do its thing, and make your fingers glide on the neck while satying focused enough to put the brakes on the automatic pilot when there is a turbulence on the way, comes from putting yourself into that situation and discovering how YOUR mind deals with it under pressure, not from just listening how others handle it.
Having said that knowing that every musician goes through similar difficulties makes it seem less unbeatable and gives hope for those who don’t have enough experience yet.