Magic is awesome, except when it just makes everything worse. It happens rarely, but sometimes magic as a whole is a net evil thing in a story. In order to bring, well, order, back to the world in question, magic has to go. Although it’s sad for both the characters losing their magic and the audience by proxy, by casting fantastical power as something that’s fun or useful but ultimately damaging, these stories can teach us something worthwhile about the importance of self-sacrifice.
YA lit is a changeable beast, and storytelling trends come and go like tides. You’ve got your magic schools, your dystopias, your paranormal romances, just to name a few. Furthermore, even when the settings vary wildly, similar themes or plot devices may crop up. For example, I’ve read two different speculative fiction books in which the characters who have magic powers received them as a result of disease. At first I was a little wary of this concept, as pandemic stories that are poorly researched, badly thought out, or not well-written can be a fresh new hell. But both of the books presented stories with interesting conceptions of disease and the limits of magical power.