I have been in the surroundings of one or two movie sets and seen that despite having so much crowd surrounding the actors they perform most of their act easily. I wonder how they focus on the scenes without losing focus or looking around in the crowd.
I can't make this into a long answer, because it's actually a boringly simple technique...
It's the same as ignoring the camera. You just do it. Those who can't do it don't work as often as those who can. This is a kind of [un]natural selection process whereby those who can do it are the ones who progress in the industry and those who can't fall by the wayside.
Even when there is no crowd, there are potentially a hundred people around, all busy doing their own job - camera, sound, director and assistants, PAs and runners, lights, costume, makeup, scripts, production, [art department] props, electricians, carpenters, painters.
You're never alone on set, it's always busy.
Behind the scenes shots aren't easy to find. Lots are taken but few are published. I found this from (I think) Captain America [copyright unknown, linked from Pinterest] and this is all for a relatively small green-screen shot with just two actors.