The tl;Dr is they do it by a massive investment in time and brainpower, mechanistically or not. Michael Caine contextualises it as living inside the characters mind.
We can recall bashful by context is true. The depth of context an actor has to carry is far beyond that, it seems to go to motivation, intent and meaning in deep ways.
The trope of an actor asking the director "what's my motivation" when they're a redshirt and die in scene 2 may actually be .. true: everyone probably has to know why they say what they say to remember to say it well.
I once asked a director "why do we spike the fine makeup station in three different fine places for the three backstage scenes?" and she replied "because the relationship between the younger actor and older actor changes between those scenes: in the first, the older is a mentor, and in the last, the younger has eclipsed him, so the angle of the station to the audience, literally upstaging the older actor, reflects his metaphorical upstaging during their careers."
Not only did that make sense, but it's an example of even the scenery profiting from learning its motivation.
It's absolutely true, in the sense that everyone on stage / screen needs a strong internal logic for why they're doing what they're doing in order for that world to come to life.
It's a basically satirical trope in the sense that only a bad and unprofessional actor would need to ask the director to tell them what it should be!
Generally the translation goes the other way. The director gives a external-result oriented note (like, "I need you to be more frantic, here"), and then the actor comes up with the reason why that would be the case.
We can recall bashful by context is true. The depth of context an actor has to carry is far beyond that, it seems to go to motivation, intent and meaning in deep ways.
The trope of an actor asking the director "what's my motivation" when they're a redshirt and die in scene 2 may actually be .. true: everyone probably has to know why they say what they say to remember to say it well.