This idiom originates from an old folk song. The final two stanzas are as follows:
A family had five brothers, all serving as attendants to a high minister. Every five days, they would return home for a reunion, adorning their horses and robes with gleaming gold. They vied with one another in ostentation and extravagance, drawing crowds of onlookers along the roadside.
There was a peach tree by a well, with a plum tree growing beside it. When insects came to gnaw at the roots of the peach tree, the plum tree invited them to gnaw at its own roots instead. In the end, the plum tree died, its wood ossified.
If even trees know how to sacrifice themselves for others, why cannot brothers do the same?