Multiple possible reasons, though I'm speaking hypothetically. I don't know anything about the situation or the show.
1) The toys you think aren't popular actually are popular and outselling pony stuff.
2) MLP has become too popular for its own good and the actors/writers/etc. are too expensive to keep on for a children's show.
3) The target audience shifting from little girls to full-grown adults has significantly hurt their ability to court advertisers since commercials for little girls' products would be lost on the people actually watching it, so a different show without bronies eating up the ratings would actually benefit Hasbro, a toy-making company.
There's a whole host of possible reasons for cancellation.
I mean, plenty of little girls do still watch the show and buy the toys. My little sister watched the show and had some of the toys for a period of time a couple years ago.
I think it has more to do with the fact that the show's popularity has faded as the fandom's dwindled over the years. The show exploded in 2011 and 2012, but that was
seven years ago. Back then, you couldn't go anywhere on the internet without seeing something MLP-related popping up in some way, shape, or form. Now? You still see it here and there, but it's nowhere near as prominent. The fanbase is still out there, just definitely not as broad as it once was.
The show's ending on its
ninth season. That's a good-ass run. Most shows are lucky to get more than one or two. If I ever get to produce the show I'm dreaming of, nine seasons is exactly how long I'd plan to go for. And that's on a plot-heavy show with lots of character development--the kind of thing that is able to keep people hooked and invested for that long. MLP managed to do it with minimal plot and character development (that stuff usually only occurred at the beginning and end of each season) with most episodes just being off the wall in some way, and most episodes being completely disconnected and self-contained.
You could tell that the MLP production team struggled a bit with compromising the show's child-oriented, episodic nature with the older fanbase's desire for more mature elements like plot and character growth. They also had to balance that craft with the obvious push for new toy material, which was the show's main purpose. I stopped watching the show during its third season, when they randomly made Twilight a princess and everything, which I felt disrupted the balance of the show a bit.
Every now and then I'd check in and see what was going on, only to be confused. There was apparently a time travel plotline that involved multiple timelines, which kinda feels like jumping the shark when most episodes deal with much more mundane things. Then the villain character from that plot (who was also a villain in an earlier plot) became good and was pushed as a main character for a long time. And I guess the most recent season was bringing up a whole new main cast of characters to replace the old ones in some way? The show was just all over the place after Season 3. Not that it made the show bad, just inconsistent.
So nine seasons seems like a good time to call it quits, before they completely run out of ideas and things just get stale. It's not like the fandom is growing and the show is getting cut off in its prime, or that the last season ended on a cliffhanger and we're not getting another one.