This is an expression that has been around for several hundred years. When you upset someone’s applecart what you are doing is ruining his plans, and in the process causing problems for the individual.
Here are a few examples. *Rekha is a friend of the groom’s and she doesn’t want to upset the applecart. *Veeru upset the applecart when he announced that he was resigning.
The “applecart” is the pushcart that vendors use to peddle their fruit. If a cart loaded with fruit were overturned (“upset”), what would be the result? The fruit would get damaged, and the poor vendor would end up incurring a huge loss leading to his ruin.