Princess Merida discovered the existence of the Will' O' the Wisps at a young age while trying to retrieve an arrow in the forest. She soon follows them, not knowing that she is being stalked by Mor'du, but they lead her back to her family before he can attack.
Years later, she encounters them again, and following their path, led her to the Witch's Cottage where she receives a fate - a changing spell. The wisps appear to her again two times, to guide her to the castle ruins where Mor'du lives, and later to lead her to her mother in danger.
When Mor'du is killed, the spirit of the Prince is freed, and he became a Wisp. One wisp is last seen near the end of the film where it waves at the viewers and vanishes.
The wisps first appear in the episode "The Dark Swan". Emma is informed that wisps can lead her to Camelot. She fights with Merida over one of them, who needs it to help save her brothers.
Mark Andrews explained the origins of the wisps, and how they treated them in the movie:"The will o’ the wisps are in a lot of Scottish folktales. They were said to lead you to treasure or doom—to change your fate—but they’re an actual phenomenon of swamp and bog gas seeping up through the earth and interacting with the natural resources to create the blue flames. People would follow these lights thinking they were little fairies, and basically drown or get sucked down into the bogs.
We made the wisps like actual little spirits. They’re almost like Marley’s ghost in a way, because Marley’s ghost isn’t an evil spirit—even though he’s frightening, he’s trying to warn Ebenezer to change his ways. That’s what the wisps are doing. There’s a duality to them because they’re either good or evil—they lead Merida into more and more trouble, but in the end, they’ve led her exactly where she needs to go."