The word petista comes from the initials of the Partido dos Trabalhadores (Workers’ Party), or PT, and means someone who supports it. Nowadays, it is often used by people from the right as a pejorative term, although it doesn’t have to be.
What is, however, a clearly pejorative term, is petralha. The origin of the word petralha is not clear, but it likely starts with the conservative columnist Reinaldo Azevedo’s book, O País dos Petralhas, or The Country of the Petralhas. Petralha is a combination of petista with metralha, the Brazilian word for the Beagles brothers (Irmãos Metralha), who would continuously attempt to rob Scrooge McDuck in the Disney cartoons.