magic how does protection work