The primary theme in O. Henry's "The Gift of the Magi" is sacrificial love. This can also be expressed in the old maxim that "it is better to give than receive." The story is told by a narrator from Della's perspective, but her feelings about her husband are clearly the same as his feelings for her.
Jim and Della Young are a poor couple who are very much in love. Each of them really has only one treasure--other than each other, of course. Jim has a pocket watch, which is a family heirloom, and Della has her long, beautiful hair.
It is nearly Christmas time, and each of them have been pondering how to get a worthy gift for the other. Della has been thinking about it for a long time.
Many a happy hour she had spent planning for something nice for him. Something fine and rare and sterling--something just a little bit near to being worthy of the honor of being owned by Jim.
Despite her attempts to save enough to get such a gift, she has only managed to save $1.87, not enough to buy a worthy gift. So, Della sells the only thing she has that is of any value, her hair, to get enough money to buy the perfect thing:
It was a platinum fob chain simple and chaste in design, properly proclaiming its value by substance alone and not by meretricious ornamentation--as all good things should do.
As you might suspect, she is worried that Jim would not like her short hair, but she bravely faces him and gives him his gift. Jim's reaction to both her hair and the gift is certainly not what she expected. He just laughs good-naturedly, revealing that he sold his watch to buy her a beautiful set of combs for her long hair.
The narrator ends the story by reminding the readers about the Magi, wise men who brought gifts to baby Jesus in the manger.
And here I have lamely related to you the uneventful chronicle of two foolish children in a flat [apartment]who most unwisely sacrificed for each other the greatest treasures of their house. But in a last word to the wise of these days let it be said that of all who give gifts these two were the wisest. O all who give and receive gifts, such as they are wisest. Everywhere they are wisest. They are the magi.
Though neither Jim nor Della had to sacrifice for the other, their love was such that they wanted the other person to have something more than they wanted to keep their own treasures. This is sacrificial love, and it is demonstrated beautifully in this story because both Jim and Della have the same level of love for one another. How tragic it would have been if only one of them had made such a sacrifice; the result would probably not have been laughter.