While hanging out at Horseshoe Bay, Applejack made Rarity a drink of the juice. Being a truth serum, it caused Rarity to announce how much she loved her friends, and more importantly, that Puce was a nice color. While still under its affects, she was much more flirty than usual and eagerly joined Captain Hoofbeard's crew. After she grew to distrust the captain, Applejack used the serum to get him to confess to his true motive. While he did, the language he used caused him to sound selfish and uncaring.
The serum is a parody of alcohol. It causes its drinkers to hiccup, have red cheeks and speak and act without thinking. Applejack using it to get Hoofbeard to confess motives is a fairly common plot point in many more adult works of fiction where characters get others drunk so they can easily manipulate them or force them to tell them a secret.