This is an interesting topic that I have been grappling to do better at as well.
I believe its a combination of how the shooter is feeling, and the overall vibe they get from the subject and vice-versa.
In addtion, I feel that the gear used tends to 'open the subject' and make them feel more at eased as well. In the shot below, it was done with a Mamiya RZ67 and a 110mm. This was a hip shot, fired pretty quickly after a brief focus as he initially rejected my request for a portrait. I took this without his knowledge, well at least till the shutter gave me away.
Striking a conversation before the shot is key, but the first point of contact is ever so much more important as that sets the tone for interaction. Sometimes you get off on the right foot, sometimes never at all.
This shot below is another shot that was taken after a 3-8minute conversation that included persuasion to be photographed. Yet, I failed to convince her for a shot. This was again, taken against her knowledge, till the shutter of the RZ gave me away.
Old habits die hard, so they say.