House-elf magic

House-elves have their own brand of magic, as do many other magical creatures. Their magic allows them to perform tasks, such as Apparating, where wizards cannot.[1] More than just a mere housekeeper, a house-elf is a ruthless protector of the master, and will attack threats with great fury and strength.

To test the security around the locketHorcrux in the 1970s, Lord Voldemort required a house-elf for the job, and Regulus Black nominated Kreacher. After using Kreacher for his purposes, Voldemort left him there to die. Bound by the laws of his kind, Kreacher was able to Disapparate out of the cave and return to Regulus because Regulus had told Kreacher to return after the task was finished.