This is the central principle of human psychology and interpersonal behavior, IMO.
Kurt Vonnegut nailed it: “We are what we pretend to be, so we must be very careful about what we pretend to be”
That racist jerk? He’s probably not really a racist jerk, he’s just pretending to be one to fuck with people. Except! That is no different than “actually” being a racist jerk.
Same thing with compassion or anything else, including intelligence. When a stranger is helping you pick up stuff you dropped, or a coworker is reasoning thought a complicated problem, it doesn’t matter if they’re “just pretending”. That is who they are, to them and to you.
My personal formulation has evolved into a small riff on Vonnegut’s insight: I think that our entire personality is simply the sum of the stories we tell ourselves about ourselves. Change the stories you tell yourself, change yourself.