Della and Jim are compared to the Magi because, like the original three kings, this young woman and young man have sacrificed valuable and precious possessions of their own and given them willingly. All their acts are made from pure love and adoration.
O. Henry injects his authorial comment that Della and Jim "are the Magi" at the conclusion of the story after noting that
...two foolish children in a flat...most unwisely sacrificed for each other the greatest treasures of their house.
At this point O. Henry draws parallels between the three wise men and the young Dillinghams as they all have unselfishly given away their most precious gifts. And yet, the author declares that the young couple are the wisest of them because they truly understand the meaning of love that asks for nothing in return. Indeed, they are "the Magi."