"Phineas and Ferb" is ostensibly about two young kids who accomplish amazing projects each day in spite of their older sister's attempts to get them in trouble. If that's all you knew about the show, it'd be easy to assume that the titular characters are the protagonists and that Candace, the older sister, is the antagonist.
BUT SUCH IS NOT THE CASE.
Protagonists are defined as having goals they want to reach which require overcoming obstacles, or making hard choices, or growing as characters. Antagonists are defined as characters that prevent (or attempt to prevent) the protagonists from reaching those goals. Because (a) Phineas and Ferb doing their big project each day is virtually guaranteed, but more importantly (b) they have no real conflict or obstacles to confront in achieving those goals, you have to look elsewhere for your protagonist. And she's easily found on the other side of the equation.
Candace attempts to bust her brothers, but not necessarily to stop them. Her greatest motivation is a thirst for justice, not to actually stop or prevent what they're doing. (And let's note that the things Phineas and Ferb do are incredibly inappropriate for children in scope, methodology, and even ethics at times. Also dangerous.) As elaborate as Phineas' and Ferb's schemes get, Candace has to concoct an equally elaborate scheme to get them in trouble for it. The difference is that Candace has to actually overcome obstacles, and here is where the story actually starts. Does Candace bust her brothers, or spend time with her sweetheart Jeremy that she loves more than anything else? Does Candace save the tape of incriminating footage of her brother's projects or save her brother from falling into the river? These internal conflicts lead to Candace actually coming to realizations each episode. Note that she's the only character who ever does that -- realize things, I mean.
But Candace's goal of busting her brothers is just as often the victim of external happenstance, and we're talking some extreme God-in-the-machine type stuff. And these conflicts add meaning, too -- these are essentially the classic Man vs. Nature and Man vs. God tickets that have filled seats for millennia. All she wants is for her brothers to get their due, and everyone ends up thinking she's crazy because no matter what, everything gets swept under the rug just in time. Her reliable frustration is fodder for the show's sense of narrative humor, but is also the same stuff that classical heroes such as Ulysses dealt with as part of their heroic journeys. Poseidon deciding to drown everybody at a whim is the equivalent of a laser beam discharging into space, bouncing off a satellite and landing exactly where it needs to to remove Phineas and Ferb's project for the day just in time.
Candace always fails, but we love an underdog, especially those that have failed repeatedly. (Look at Abraham Lincoln.)
The show's B plot involves a stereotypical villain who is always trying to take over the tri-state area and failing, and his story is much the same as Candace. He has a concrete goal and always comes close to achieving it, but fails reliably each episode. While there's ostensibly a secret platypus agent whose entire job is to foil him, more often than not Doofenschmirtz is the one who inadvertently allows Perry the Platypus to escape and beat him. Losing to yourself is another classical storytelling tradition, and one need look no further than the heroic flaws of Oedipus or Hamlet. Doofenschmirtz is also the character who probably has the most lines of each given episode, and also probably the character about whose past we know the most. Many of his schemes are born out of comic/painful childhood memories, which actually fleshes him out as a character quite a bit (at least for a 12-minute kid's TV show character). As such I consider him the protagonist of the show's B plot.
So why is the show called "Phineas and Ferb?" If you've seen early episodes of Phineas and Ferb, you'll note that the stories tend to focus more around those two characters and the celebration of their interesting accomplishments. You'll also note that those episodes are pretty boring. The show's title sequence, which they continue to use and is quite catchy, is also meant to serve as a celebration of the boys and what they do. After a run of initial episodes, though, I wonder if the writers took a look at their formula and realized that the actual meat of "Phineas and Ferb," the actual story, had a lot more to do with characters like Candace and Doofenschmirtz fighting against the show's rigidity. Like Bill Murray's character in "Groundhog Day," Candace and Doofenschmirtz are essentially the only real people in a world of constants.
Phineas and Ferb doing whatever they set out to do is not the story of "Phineas and Ferb," but the backdrop. A given episode could conceivably involve them not accomplishing what they set out to do, but the parameters are so set and so square that it's like a mime's box -- the box isn't actually there, but it might as well be. The writers of "Phineas and Ferb" are those mimes, creating an unnecessarily rigid episode structure and making the show not about what's within the box, but the box itself and how the characters interact with it.
If you think about each given episode as really two different stories, things make more sense. The first layer is the rigid episodic content that is completely reliable, down to some exact lines -- Phineas says "Hey Ferb! I know what we're going to do today!" followed shortly thereafter by "Where's Perry?" and preceded by Isabella arriving and saying, "Whatcha doin'?" Everything is wrapped up and Candace is unable at the last moment to bust her brothers due to extreme contrivance and their mom invites everybody in for snacks. Many shows will be repetitive intentionally so as to provide a level of subconscious comfort to viewers -- they know this story, they know they like it, and they'll enjoy it at least one more time -- but the "Phineas and Ferb" writing team hang a lantern on it, accentuating at any point possible exactly how much this episode is just like every other episode of the show.
This narrative intention makes more sense when you think about there being a second layer to these episodes. When the show is exactly the same every single time, there are consistent victims, too -- our respective heroes Candace and Doofenschmirtz. They're trapped in a comically unfeasible prison where the only things they want they will never, ever get because the show's consistency demands it. The show is really about the prison of episodic content, and THAT'S WHY EVERYONE WATCHES IT.
The music is great, the humor is good, the voice acting is stellar, and the two protagonists are perfectly placed, but the actual charm of the show is the fact that it's constantly winking at the viewer, using tropes as a crutch while simultaneously mocking the tropes. American TV audiences have absorbed a lot of episodic content, particularly those with children who watch children's television shows -- such as "Phineas and Ferb." While the kids will watch it because two boys are building rocket ships and robots in their backyard, parents will let Netflix queue up the next episode because it's also a show about American television in general, about our need for the familiar and our simultaneous disgust of it.
Okay, well, that sentence is probably a sign that I need to go to bed.