Why I say 'I'm fine' when I'm not
The pattern, in five beats
Someone asks 'how are you?' in passing, in the hallway, at the coffee machine, on the phone. The word comes out before you've had time to check if it's true.
The word comes out on its own
It's 9:14, a colleague walks past your desk and throws out 'how's it going?' without really stopping. You answer 'good, and you' before you've even looked up from the screen. The sentence came out faster than the question was finished.
The tone is flat, quick, almost a formula you close like a door. It's not exactly a lie, it's a reflex, the same gesture as grabbing your keys on the way out.
In the evening, on the phone, your mother asks the same thing and the same word comes back, at the same speed. You didn't have time to ask yourself if it was true, the mouth had already answered.
What it avoids
Saying 'I'm fine' avoids the pause that would follow if you said something else. It avoids having to explain, in a hallway, between two doors, what exactly isn't fine.
It also avoids watching the other person's face change, having to manage their reaction on top of your own. A real no would take time neither of you has, standing there, between two meetings.
And above all it avoids becoming, for five minutes, the subject of the conversation. 'I'm fine' leaves you invisible, which is sometimes exactly what you're after at that exact moment.
What I will not tell you
I will not tell you to answer honestly next time, or to say what you actually feel. That kind of advice assumes the problem is the word, when the word is only the output of a mechanism far faster than it.
What shifts isn't the sentence you choose to say. It's that half second before, the one where the mouth has already decided while the rest of you hasn't yet had time to check if it was true.