According to the Pinkie Pie and the Rockin' Ponypalooza Party! book, the Pie family maintains their rock farm to mine for rocks, which they sell to customers as building material (possibly for someone's house) and as pet rocks for young colts and fillies.

You have to wonder if a rock farm is profitable enough to make a living.

Sometimes, one must speculate, if the Pies uncover a nugget of a precious metal (gold, silver, or platinum) or a batch of gems (diamonds, rubies, sapphires, etc.), which of course they sell to customers.

Of course, they'll have to hire a friend (Rarity) of a family member (Pinkie Pie) to help uncover gems to help keep the family (rock) farm in business!!!!