Who are the magi, what is the theme of the story, why did each give their most prized possession away, was all of this wise?
Let me give you the summary here that will answer many of your questions.
First, the magi in the story are the wise Jim and Della. They are considered wise, because they gave gifts of sacrifice. In other words, they considered the needs of others more than their own needs.
So, in their poverty, they sought to sell their most prized possessions to show their love for each other.
Jim sold his prized pocket watch, and Della sold her beautiful hair. The irony here is that Jim knew that Della loved her hair. So, he bought her combs. Della knew that Jim loved his pocket watch. So, she bought him a chain for it. In the end, they had gifts that they could not use. But there is something beautiful about it, because it underlines sacrificial love. O. Henry chose to use the idea of Magi in short story, because they gave gift to Jesus in the New Testament.