However, the locket was a Horcrux, a magical object containing a fragment of Voldemort's soul. The locket was enchanted with a powerful dark magic that preyed on the wearer's deepest fears and insecurities. It was only after Ron and Hermione destroyed the locket's magical properties that Harry discovered its true nature.