Shadow Crystal

The Shadow Crystal is an evil artifact used by Zant. He attempted to use it on Midna but missed and hit Link instead keeping him permanently in his Wolf Form. After Link had found the Master Sword, its The Power to Repel Evil cleansed the Shadow Crystal from his body returning him to his Hylian form. With the crystal in hand Midna could freely change Link into a wolf and back whenever the two desired.

The wall which separates Twilit Hyrule from the rest of the realm is made up of a dense conglomeration of shadow crystals called shadow fog. Whenever Link passes through this barrier, he is instantly reverted to his Wolf Link form.