Trixie and Pinkie are friends through more or less both being entertainers, who both (at the time) weren't appreciated much for their work.
The two became friends after Pinkie showed up to one of Trixies' performances. Pinkie coming from a small town had never seen one of these before, and was amazed at 'The Great and Powerful'.
The two became friends through Pinkies consistent admiration / support. Often supporting when she could. Helping the Mare with parties, and sharing tricks with another.
(After Twilight arrives-)
During 'Boast Busters', Pinkie along with Fluttershy both didn't want to get involved with Rarity, Applejack, and Rainbow Dash feuding with Trixie just because she was doing her job.
After Twilight was forced to get involved with the Ursa Minor, Trixie publicly humiliated left the town.
News spread's quick in Equestria, and by the time Trixie entered a new town, they had already heard of her encounter and promptly kicked her out.
Being forced to find seemingly more and more obscure towns to recluse in, eventually finding her way to Pinkies hometown.
Trixie fed up with how people treat her, decides to bury her talent and just work on a Rockfarm. By fate of her own, it turns out she is working on none other than Pinkie's family home.
Pinkie coming back home to check up on her family, finds that Trixie had been working on the Rockfarm for weeks at that point.
Pinkie offered Trixie some oddball jobs she occasionally takes up, afterall that's what friends do for another!
Anyways so Trixie bought an amulet which ended up slowly possessing her, in which Trixie's sadness and grief turned into nothing short of hate.
Eventually Trixie rants that she had to work on a Rockfarm to get by, having to give up her talent in the process which was embarrassing.
Pinkie fed up by this point of Trixie taking advantage of her niceness, and tormenting her friends says;
"Hey! You're lucky a rock farm would take the likes of you!"
Before Trixie nearly instantly casts a spell removing the mares mouth, and by that ruining their friendship in the process.
(I have not worked on a resolution yet, or if they should become friends again, since I am still working on the story for my comic.
I will have art following this post once I get around to making it, so stay tuned for that!
And let me know if this is good, and or if I should do something another way because I love feedback!)