In my experience, I have found that, for me, anger is really fear. People don't like thinking of it, that way, because angry people are "strong," and fearful people are "weak."
But I have had to face these types of things. Long, sad, story. Bring your hanky.
In both cases (fear and anger), the feeling needs to be temporary, if at all possible, because they are protective armor, meant to gear up our bodies and brains for a "fight or flight" scenario.
When I am fearful (including angry), my brain doesn't get "stupid," but it gets "binary." There's no "gray areas," or calculation of long-term cost. Only "No Threat" or "Threat." Bad decisions get made, very quickly, when we are on a fear binge. That's one reason why "managing by fear" is a pretty bad idea for knowledge workers. Soldiers and first responders train on how to make decisions under fear stress, but they know their limits, and their decisions are very much "short term."
Demagogues have known for centuries, that, if you get the people scared, you can make them support pretty much anything that you want. They know how to guide that "binary" thinking.
Compassion is important, and one way (in my experience) to learn it, is to work with people that are hard to like.
Compassion will always be intermittent and fall prey to the factors you cited if not a foundational component of an individual's personal code.
As an experiment, in 2012 I spent a week on the road to hand-deliver a letter of need (not my own) to 25 of the largest philanthropists to liberal causes. Not one of them responded or helped personally, six of them had a staffer send a form letter of rejection.
My conclusion is that compassion is too often valued only when self-serving. i.e. Dozens of uber-wealthy donate to charities that support the homeless and/or drug addicted, but view the "actual people" who collectively define the issue with suspicion and disdain.
Compassion felt towards people who share your genes or people who will likely reciprocate is adaptive.
Compassion felt towards animal prey and enemy tribes is maladaptive. We had to eat and be able to kill others in a skirmish.
So it's no wonder people can switch it on and off in the presence or absence of contextual cues. It's in essence a thing that's designed to be self-serving.
Because pets have been engineered by us through artificial selection to have phenotypes that co-opt our adaptive tendency for compassion, in this case it's a tendency that was evolved to make sure we care for our own kids. It's analogous to when a parasite or virus or idea may co-opt certain adapted systems to survive and spread. Such viruses are usually bad for the host's fitness. The co-opted compassion we feel towards pets is possibly maladaptive because it may decrease the expected number of children, since pets can be substitutes.
You could ask the same question of any virus or idea or parasite that is currently co-opting evolved systems.
One answer is that it's an evolutionary arms race. Evolution vs evolution has no clear winner. In this case, it's powerful artificial selection by dog breeders to create products that co-opt our compassion for our children.
Another answer is that evolution needs more time to figure out how to beat it.
Another answer is that it's not actually maladaptive because the assumption that pets reduce children isn't true. It may be adaptive because having a pet increases happiness. But even if this is true, it doesn't impact the validity of the thesis that compassion is a self-serving adaptation that gets switched off when needed.
Viruses exist on a much smaller space time scale than human and they evolve and mutate much faster. In fact, we are in a constant arms race with pathogens (see development of antibiotics and the rise of antibiotic resistance).
As far as I know, bear cubs, wolf cubs, tiny lizards, etc have been cute for the entirety of recorded history, and probably much longer.
So that does not seem like a very apt comparison.
Also I think that you are conflating the survival mechanism of an organism - for example malaria latency - with a maladaptive immune response of the host - for example cytokine storm.
Can you describe your experiment in more detail? Even with more detail, this seems like too anecdotal and not controlled to draw meaningful broad conclusions that you seem to be drawing, but regardless sounds very interesting.
It’s interesting to compare these emotional states with the mechanics of inflammation and the interaction between the immune system and the central nervous system and impact on behavior.
Compassion is effectively how a persons ego reacts to others unless they can figure out a way to practically help the person/people they are feeling compassionate about.
There are an alarmingly large number of people who use the word 'compassion' when they see substance abuse addicts preferring to live on the streets and causing mayhem, often due to their resulting serious mental illness.
Unless you have practical, effective solutions for those people and the society they live amongst I would argue much of what people like to think is 'compassion' is actually cruel enablement that perpetuates suffering.
That 'compassion' is invariably well meaning but all too often wildly impractical and can actually make the suffering worse.
Pity and compassion, sympathy and empathy: we experience these 'forces' in alloy-form. But when we speak of them, we speak as though our common experience is with the pure form of these things.
Consider the narrative on the topic between Schopenhauer (compassion) and Nietzsche (pity).
Physics plays some part here, if only because compassion involves change and motion, where pity remains emotional.
"a flow of love that moves from one person to the other in the presence of suffering"
This is a circular definition of compassion, according to Buddhism. Rather, Buddhism defines compassion as the wish for others not to suffer, and loving-kindness as the wish for others to have happiness.
But I have had to face these types of things. Long, sad, story. Bring your hanky.
In both cases (fear and anger), the feeling needs to be temporary, if at all possible, because they are protective armor, meant to gear up our bodies and brains for a "fight or flight" scenario.
When I am fearful (including angry), my brain doesn't get "stupid," but it gets "binary." There's no "gray areas," or calculation of long-term cost. Only "No Threat" or "Threat." Bad decisions get made, very quickly, when we are on a fear binge. That's one reason why "managing by fear" is a pretty bad idea for knowledge workers. Soldiers and first responders train on how to make decisions under fear stress, but they know their limits, and their decisions are very much "short term."
Demagogues have known for centuries, that, if you get the people scared, you can make them support pretty much anything that you want. They know how to guide that "binary" thinking.
Compassion is important, and one way (in my experience) to learn it, is to work with people that are hard to like.