 Aslan tells Digory how the tree works - anyone who steals the apples gets their heart's desire, but in a form that makes it unlikeable.In the Witch's case, she has achieved immortality, but it only means eternal misery because of her evil heart.Moreover, the magic apples are now a horror to her, such that the apple tree will repel her for centuries to come, but not forever.