Heroes and villains can be contrasted in many ways: beauty and ugliness, modesty and skimpiness/sexiness, politeness and rudeness, among other things. In this dynamic, the hero is contrasted with the villain in terms of maturity levels.
While some works present childishness as an endearing trait, in this dynamic the hero's lack of childishness is what makes them better than the villain. This makes sense to an extent; many immature qualities such as pushing the blame, entitlement, self-centeredness, callousness, pettiness, cowardice, acting spoiled, etc. are almost always associated with villains and jerks. In contrast, mature traits such as forgiveness, taking responsibility for one's faults, losing gracefully, humility, a sense of responsibility, etc. tend to be related to heroes.
This trope can manifest itself in a number of ways. If the hero and villain went to school together, expect the hero to have matured since then, while the villain hasn't grown up at all. If the hero and villain desire or have power, the hero tends to be responsible with their power, while the villain values power purely for the privileges and scoffs at such silly ideas like "obligation." This dynamic doesn't even have to involve heroes and villains; a mature Nice Guy and an immature Jerkass work just as well.
A common variation of this trope is to have a younger hero who shows more maturity than an older villain, with the hero displaying wisdom and maturity far beyond their age, while the villain acts very childish for their age.
Compare Older Hero vs. Younger Villain, where the hero literally is older than the villain, which this can overlap with. Also compare Snarky Villain, Earnest Hero; Diligent Hero, Slothful Villain; Hammy Villain, Serious Hero; Insecure Protagonist, Arrogant Antagonist; Good Is Not Dumb; Stupid Evil; Not Growing Up Sucks.
Contrast Dumb Is Good, Growing Up Sucks.