People do what they do for a rainbow of reasons not necessarily obvious or shared with the observer. So, too, can the characters authors create.
I liken this behavior in real life and fiction to Freud’s psychoanalytic personality theory. According to Freud, the Id, Ego and Superego combine to create the complex behavior of human beings. The initial behavior, be it reaction or explanation, is the Superego in action and dialogue. It’s the “politically correct” reason most easily accepted by the most people. Pursue the matter further and you may discover the Ego, a more personal yet still rational reason for the thought process that led to the behavior.
The Id uncovered is what a social worker friend of mine calls “The Core Reason.” This is the real reason for the behavior. The Core Reason motivates the person to act, defines character in real life and fiction, rules their ambitions, articulates the desired outcome.
Is the intent for good or selfish gain? To help or to hurt? To contribute or dismantle? In bringing your character to life, are you peeling back an onion or dissecting a flower?
What is your Core Reason?