Wild Magic

Wild Magic is a fantasy novel by Tamora Pierce, the first in a series of four books, "The Immortals". It details the emergence of the powers of Veralidaine Sarrasri (aka "Daine") as a wild mage and her coming to Tortall.
Plot introduction.
"Wild Magic" is set in the same world as "The Song of the Lioness" quartet. Daine's family was killed earlier in the year by raiders and after enacting revenge upon the raiders, she runs away to find a new life. She gets a job as an assistant to the horsemistress of Tortall's Queen's Riders, and she learns new things about herself and gains a new family.
Plot summary.
The reader is introduced to Veralidaine, (who goes by Daine), a thirteen-year-old girl who can speak to animals. Daine meets Onua, the woman in charge of the horses for the "Queen's Riders", (the group of warriors who ride with and for the Queen), and is hired to help bring up a group of new ponies to the capital of Tortall.
Along the way, Daine and Onua are attacked by strange creatures called Immortals, which are mystical beings including monsters such as spidrens, (huge, carnivorous spiders with human heads), and Stormwings, (metallic birds with human faces that feast on the dead). They later learn that nearly all of Tortall, Scanra, Galla, Tusaine, Maren and Tyra are being plagued by these Immortals, despite the fact that they were supposed to have been locked away years ago.
As it turns out, the Immortals that attacked them had been on the chase of a hawk, which Daine rescues using her powers. With the help of Alanna of Trebond, Daine turns him back into a human, and he turns out to be Numair Salmalin, the most powerful mage in Tortall and one of the few black-robe mages in the world. Upon reaching Corus, she continues as the assistant horsemistress, teaching Rider trainees such as her friends Miri and Evin and learning more about her own powers of "wild magic" from Numair, who becomes her teacher. She discovers the true depth of her power and learns of its advantages and dangers.
During a journey to Alanna's home, Pirate's Swoop, Daine tells Onua and Numair about how she had lost her mind after the murder of her family and joined a pack of wolves to kill the bandits who had killed her family. The townspeople of Snowsdale then realized what was happening and tried to kill her, so she fled. After a time spent wild with the wolves, she regained her humanity and sanity with the help of Cloud, her pony. Relieved that her friends still like her after her confession, and after Numair enacts a spell so she will not lose her mind once again, she begins to hone her powers and soon learns to heal animals.
She is visited frequently by the male badger god, who tells her that he promised her father he'd look after her. The badger god gives her a claw to wear around her neck that will allow him to contact her, and is very angry after she nearly kills herself by accidentally stopping her heart in order to hear dolphins. She finds out that she is able to talk to certain Immortals as well, and manages to convince several griffins not to harass the people of Pirate's Swoop.
Towards the end of the book, she saves Pirate's Swoop from an attack of pirates and Immortals who are under orders from Carthak, a neighboring country. She defeats them by calling a kraken from the far away ocean floor. She's also left in charge of a dragonet, whose mother Flamewing has died in the battle to help save Tortall. Daine names the dragonet Skysong the name her mother Flamewing passes on to her before she dies, and raises her like her own.