As related in O. Henry's "The Gift of the Magi," Jim and Della are very poor and don't have many fine possessions to their name. With Christmas approaching, Della is desperate to come up with more money so she can buy Jim a present. The reader can assume Jim feels the same way based on his later revealed actions, though his thoughts are not revealed.
Despite their poverty, Jim and Della are very proud of two of their possessions:
One was Jim's gold watch that had been his father's and his grandfather's. The other was Della's hair. Had the queen of Sheba lived in the flat across the airshaft, Della would have let her hair hang out the window some day to dry just to depreciate Her Majesty's jewels and gifts. Had King Solomon been the janitor, with all his treasures piled up in the basement, Jim would have pulled out his watch every time he passed, just to see him pluck at his beard from envy.
As the reader learns later in the story, Della sells her glorious hair to get the money she needs to buy Jim a chain for his watch, which she feels he deserves:
As soon as she saw it she knew that it must be Jim's. It was like him. Quietness and value--the description applied to both.... With that chain on his watch Jim might be properly anxious about the time in any company. Grand as the watch was, he sometimes looked at it on the sly on account of the old leather strap that he used in place of a chain.
In a similarly self-sacrificing manner, Jim sells his watch to get the money to buy Della the tortoise-shell combs for her beautiful hair that she had "worshipped long in a Broadway window." In this way they both "sacrifice their treasured possessions to enhance the treasure of the other." Ironically, neither can use the special gift the other has bought for him/her.
The author does not leave the reader, however, to think of theirs as a foolish act - though he momentarily calls Jim and Della "two foolish children in a flat who most unwisely sacrificed for each other the greatest treasures of their house." Instead, O. Henry goes on to compare them to the magi who brought gifts to Christ, and he ends with the thought that they are truly wise, for they understand the importance of generosity and sacrifice for those they love:
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.