The theme of "A Poison Tree" examines the detrimental effects of harboring anger. In this poem, the speaker is angry twice: once at a friend and once at a foe. When he's angry with his friend, they talk it out; his anger thus dissipates. In contrast, when he's angry with his enemy, he holds it inside. The anger grows into "wrath." This connotes a more powerful form of anger. A common term is a "wrath of vengeance." When anger reaches this level, people seek revenge. The speaker nurtures this anger, allowing it to grow until it becomes a symbolic apple.
The speaker's foe tries to steal from him and ends up eating his anger-filled apple. When it kills him, the speaker is "glad" to see him stretched out beneath the tree.
The overall meaning here is that the speaker has now become something he never intended to be. His heart is so hardened by the anger he has allowed to grow that he doesn't care about the devastation he has caused; in fact, the pain of his foe brings him happiness.
So who wins here? Not the foe, and not the speaker. Living in anger causes unforeseen consequences to one's character.