I guess this is a picture of the phone in question. And in case you haven't heard of it yet, link!
Now I'm not going to say I'm not guilty of doing this myself. It was actually probably about last year that I stopped doing this.
It stemmed from me being protective of my phone. When I was a teenager, I would want to use my phone later than I should have been. I started putting it under my pillows when my parents would come into my room and check my messages and see how long I was up talking to my girlfriend at the time. If it was after 10 pm, I'd lose the phone. And they could usually tell when I deleted messages to cover it up.
Back then, you could put a phone under your pillow and get away with it. My phone (when I was 16) was a Motorola RAZR ve20. At that time, flip phones were kind of the standard phone. Everyone had em. Unless you were rich and you had an iPhone. When I was a teenager, the iPhone was a superpower, but its processor only clocked at 412 MHz. Processors back in the day just didn't get as hot since they weren't clocking so high.
These days, the processor in my phone (1.9 GHz) clocks higher than the one in my laptop (1.4 GHz), and the laptop actually uses active cooling! Phones are much more active than they appear. It might look like they're doing nothing while in standby, but they can be doing tons of things at once, which engages the processor. It doesn't help that phones have to use passive cooling (because nobody wants a phone that uses a fan). Just sitting there, a phone doesn't get very hot, but if it's doing something, it's putting off a little heat. Insulate that with your pillow, and that heat will build up over time until...well...this happens.
It looks to me like the phone got really hot under the pillow and the battery swelled, causing the fire.
Here's the thing: just don't put your phone under your pillow. The things are way too powerful to be doing that anymore. Even if you don't start a fire like this, you can still cause damage to the internals of the phone and shorten its life. And this isn't a common sense thing at this point. She's only thirteen so you can't expect her to know much about the way these things work, but maybe she won't do that anymore.