https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5617204/

This indicates, that it's not true that women are more compasionate/generous for the people (even off their same gender) below them in status.
It's more so that men are more compasionate/generous for the people (also off their same gender) below them in status.

The idea that women are more compasionate/caring; probably comes from the idea that women are more concerned with keeping good/positive personal relationships.