There's lots of magic in Narnia, but there are two bits of magic that are particularly important for the plot: the Deep Magic from the Dawn of Time and the Deeper Magic from Before the Dawn of Time. The Deep Magic from the Dawn of Time is basically an eye-for-an-eye, tooth-for-a-tooth moral law. As the White Witch explains:
"[…] every traitor belongs to me as my lawful prey and […] for every treachery I have a right to a kill." (13.41)
Although at first glance this might seem like a law that's all about the Witch, it's really about the treachery that a person commits. When somebody commits a great crime, the way that Edmund does when he betrays his family, then they have to face the moral consequences of that crime. To put it in religious terms (as Lewis was probably thinking about it), they have to atone for their sins. In this sense, the Witch is just a mechanical function built into the world to carry out this moral law, the way that Satan is supposed to punish sinners. Or, to use the symbolism from a different religion, the way karma brings the consequences of your actions back to you. We can think of the Deep Magic as similar to the laws and rules laid down in the Torah, the first five books of the Hebrew Bible, which Christians call the Old Testament.
Still, in Narnia, just like in Christianity, there's a major loophole in this law: the Deeper Magic from Before the Dawn of Time. Aslan explains:
"[…] when a willing victim who had committed no treachery was killed in a traitor's stead […] Death itself would start working backwards." (15.38)
This is the amazing thing about Aslan's sacrifice: by taking Edmund's place, Aslan is able to save Edmund, but also to save himself and everyone else. There's a special power he can access by being a willing and innocent victim. Allegorically, Aslan's sacrifice represents Christ's crucifixion – the great act of sacrifice by which Jesus is supposed to take on the sins of the world. We can think of the Deeper Magic as symbolic of the grace, mercy, and sacrifice emphasized in the Christian New Testament.
Of course, there are differences between Aslan's sacrifice and Christ's crucifixion. Aslan sacrifices himself for Edmund, while Christ sacrifices himself for everyone in the world. Christ, unlike Aslan, is not a giant talking lion (just thought we'd point that out). You know, those sorts of things. Yet there are also a lot of parallels in the way the sacrifice happens. Like Jesus, Aslan knows what he has to do and is depressed about it. Like Jesus, Aslan is tormented and humiliated before being killed. Also, like Jesus, Aslan appears first after his resurrection to some of his faithful female followers.
If you want to think about some other aspects of the Christian allegory underlying The Lion, the Witch, and the Wardrobe, consider comparing Susan and Lucy to Mary and Martha, or Edmund to Judas. We've got more on these ideas in the "Characters" section, so check those out too!