Whew. OK. The Mule went back to his empire, which includes the First Foundation on Terminus, but he stops expanding his reach. He's still wary of the Second Foundation, and he wants to find and crush them before making any more risky moves. He sends out expedition after expedition in search of it. All he has to go on are Seldon's words, saying that he was going to establish two foundations at opposite ends of the galaxy, so spaceships from Terminus keep going across the diameter of the circular galaxy. The search we care about has Han Pritcher at the helm, accompanied by Bail Channis, who the Mule thought might be a Second Foundationer, and thus might actually make the search successful. Han Pritcher was helping Bayta Darell and Hubby to fight the Mule in the last book, but after an assassination attempt, the Mule converted him to a loyal follower.
We see some brief snippets of a "First Speaker" of the Second Foundation, talking about how they're going to let the Mule find them, on their terms. It turns out that Bail Channis is indeed a Second Foundation man, and through an ever-escalating series of "but if he knows that we know that he knows that we know that he knows," the Second Foundation finally gets the upper-hand over the Mule, and alters his mind so that he doesn't want to find them anymore. All the Mule wants to do now is go home and play nice. He does that, and when he dies, the empire essentially dies with him, since he's sterile (hence "The Mule"), and the empire was one giant cult of personality that could not survive without the personality.
Years later, Bayta Darell's granddaughter, Arkady, gets herself all mixed up in things, and she plays a crucial role in helping the Foundation find and destroy its red-headed step-sister. She travels all over the galaxy, to Trantor and back, and while on Trantor, realizes that a circle has no end, and if you want to find the opposite end of a circle, you'll end up back where you started. In other words, the Second Foundation is on Terminus!
Foundation leaders root out and disable the group of Second Foundationers that were living on Terminus, and consider the case closed. The First Foundation is once again the only Foundation, and it is well on its way to ruling the galaxy.
Unluckily for them, the Foundation did not realize they were up against the champions and still undefeated masters of "but if they know that we know that they know." It was ALL a trick. Arkady's mind had been tampered with by the Second Foundation at her birth, and planetary events were delicately maneuvered for years to end up with her bringing the untruth to the Foundation and making them think that they had discovered the real hiding place of the Second Foundation.
Where is it REALLY?! On Trantor. Seldon had told the truth. Trantor was both the social opposite of Terminus (center of administration vs. uninhabited, ignored planet), and the physical opposite (in a spiral, the line ends in the middle of the circular rim). The Second Foundationers, with their myopic focus on keeping the Seldon Plan runnig properly, had needed to do something drastic to prevent destruction by the Mule, which brought them into the open. For the Plan to work, though, nobody could know that there were Plan Monitors, keeping everything on track. Nobody likes to think that they don't have free will. So they sacrificed dozens of their men to ensure that the First Foundationers would be convinced that they were free of the Second Foundation, once and for all.