In Earthbound, he starts off as Ness's neighbor and friend. He and Ness learn about the world's impending doom at the hands of Giygas, and unlike Ness, Porky's cowardice gets best of him. While Ness goes off to save the world, Porky doesn't show up again for awhile. He returns later in the game, where he kidnaps Ness's companion Paula, with the intent of using her as a human sacrifice for a cult called the Happy-Happyists. When Ness defeats the cultists, Porky apologizes to Ness, but then says that he's lying and flees. He shows up later, living in luxury in Fourside with his dad, and when Ness confronts him, he flies away in a helicopter and doesn't appear until the end of the game. It's revealed that he's been inadvertently causing problems for Ness and his friends along their journey and that he's played an active part in fueling Giygas's growing power. When the heroes time travel to the Cave of the Past to fight Giygas, Porky is his right-hand subordinate. He taunts Ness and says that he serves Giygas now. He turns off the Devil's Machine, releasing Giygas's true form and then flees to another era in time (presumably where/whenever Mother 3 takes place). It's also presumed throughout the game that Porky is jealous of Ness and his friends. His parents hate him and it's implied that they're abusive, so when Porky is too cowardly to join Ness on his quest to save the world, he's left all alone. This causes him to snap, and confused, he decides to take it out on Ness in traditional bully fashion.
Anyways, he shows up again in Mother 3, as the king of the Nowhere Islands and leader of the Pigmask Army. He doesn't appear in person until the very end, but a lot of horrible stuff happens as a result of his control. Firstly, the Pigmasks are all brainwashed soldiers from different time periods that carry out his deeds (they're basically Nazis). He also kidnapped Dr. Andonuts (Jeff's dad, who was also in Earthbound) and forces him to create chimeras out of the animals in Lucas's hometown of Tazmily. One of these chimeras, the Mecha-Drago, kills Lucas's mother Hinawa, which in turn tears Lucas's family apart. His father Flint grows distant, and his brother Claus runs away. Later on, Porky has Tazmily completely modernized and issues brainwashing devices called "Happy Boxes" to be placed in everyone's household, with the intent of making the villagers love him unconditionally as their ruler. He also finds Claus's body, who, in an attempt to avenge his mother by killing the Mecha-Drago, fails miserably. The Pigmasks rebuild Claus's body and brainwash him into becoming their general (referred to as the Masked Man, but you don't find out that he's Claus til later). Porky intends to use Claus to pull the seven needles, which will bring about the end of the world (which Porky wants to rebuild in his image). Eventually, you finally encounter Porky in New Pork City, where he reveals that everything he did to Tazmily village was done out of sheer boredom. While battling Lucas and his companions, he also states that he is immortal and wanted to eradicate all life in the world just so he can be the only person left alive. When his spider mech runs out of power, he locks himself in the Absolutely Safe Capsule, which once shut, can never be reopened again. So he's left there unable to die, unable to leave, and unable to be truly defeated. And... then Lucas has to go fight to the death his brainwashed brother in the saddest moment in gaming history... all because of Porky and his horrible plans.
I'm sure I forgot some stuff, but I hope this was insightful. Seriously though, Porky is a really complex character, and that's what makes him such an interesting villain. The weird thing is that in both games, you feel sorry for Porky despite everything he's done. He's still just a kid after all; a lost, neglected, abused kid who wanted nothing more than to be loved. But yea, he ends up becoming a real piece of s***.