How does O. Henry create tension and surprise in “The Gift of the Magi”?

How does O. Henry create tension and surprise in “The Gift of the Magi”?