There are two ways in which to answer this question and they are both symbolic.
First, there is a conflict of love. Both Jim and Della want to outdo one another in love. They want to express their love in a way that accurately shows the depth of their love for one another. So, they both sell what they prize the most to express and show their love to one another. Della sells her hair and gives to Jim a chain for his watch and Jim sells his watch to give Della combs for her hair. In light of this, they sought to show love in extravagant ways.
Second, what made these acts of love difficult was that they were poor. The open lines of the story shows their poverty, as Della counts the pennies that she possessed and saved.
In the end, both win. This is the irony of the story or to use the language of O. Henry, this is why they are magi. They found the beauty of giving.