The episode begins with two boys running and peeks through a board that cover an abandoned cave. They are shown friendly to each other. One of the boy try to pull the board but failed. Then the other boy punch the board and destroyed it, and they get inside. Then, they write their name in the wall to let people know that they "own" the place, after they leave, it's revealed that they are young Stanley Pines and Stanford Pines.
Stan Pines, cornered under the Mystery Shack, greets the Author with a hug. However, the author responds to this by punching Stan and refuses to thank him for freeing him from the Universe portal, saying that he took a huge risk by re-activating it. In addition, the author says that Stan was the reason he was trapped in the first place. Mabel interjects and asks what is going on, and Dipper is so excited to meet the author for the first time he nearly barfs, respectively. We soon learn that the Stan that Mabel and Dipper know is actually named Stanley and he stole his brother's name: Stanford. Stan says that he has a lot of explaining to do, and starts to explain his life story.
Stanley and Stanford were twins born in the town of Glass Shard Beach, New Jersey during the 1960s. Their parents owned a pawn shop, their father implacably stoic and their mother a pathological liar/phone psychic. The two loved exploring the town's beach and one day, they came across a cave that held a broken ship. The twins made it their goal to fix it up and use it to sail around the world together to hunt for hidden treasure. Throughout his life, Stanford was bullied for having six fingers, but he knew he always had his brother, Stanley, beside him.
The twins could not have been any more different. Stanley was a troublemaker who was barely able to graduate while Stanford was a straight A student who won most of the science competitions at school. One day, a perpetual motion machine Stanford built for a science fair earned him an opportunity to be accepted into his dream college, West Coast Tech. Although Stanley still had his dream of sailing around the world in their boat, Stanford had his mind set to get into the college.
One night, an upset Stanley went into the gym to look at Stanford's experiment and hits the table in frustration, accidentally destroying the experiment. When the college admission team came to look at Stanford's experiment the next day and saw it wasn't working, they denied Stanford's entry into West Coast Tech. Stanford confronted Stanley at home, and Stan's family believed that he did it on purpose to try to prevent Stanford from going off to college without him. Filbrick gets so angry he kicked Stanley out of the house for ruining their chance of becoming rich. Stanley then dedicated his whole life to getting enough money to prove his family wrong by becoming a businessman. However, his products were unsuccessful and Stanley got banned from many states and countries, using fake identities to travel to new places. Stanley went to prison in three different countries (one of them Colombia).
Meanwhile, Stanford gets accepted into Backupsmore University and graduated at the top his class, acquiring a grant for his scientific research. Stanford decided to study anomalies, attracted to them because of his anomalous sixth fingered hands. After some research, Stanford pinpointed the place in the world with the highest amount of anomalies, Gravity Falls, and moved there. Stanford enlisted the help of locals to build his house and went around the town recording all of his research and findings in three journals. Stanford ultimately believed that all the anomalies of Gravity Falls had to originate from another dimension, and decided to build the Universe portal to help him get there. He enlisted the help of his college buddy, Fiddleford McGucket, whose technical know-how resulted in the complete construction of the Universe portal.
When the portal was activated for a test run, McGucket was almost sucked in. Stanford managed to pull him out, but McGucket wasn't himself and began to act strangely. He spoke in backward ciphers and issued a strange warning: "When gravity falls and earth becomes sky, fear the beast with just one eye." After recovering, McGucket told Stanford that the portal was too dangerous and urged him to shut it off, quitting the project when Stanford didn't do so. McGucket decided to forget what he had seen. Once Stanford began to hear whispers and felt that he was losing his sanity, he asked the only person he could trust - Stanley - to come to Gravity Falls.
As the two meet in Ford's home, Stanford asked Stanley to hide the first journal far away from Gravity Falls to prevent anyone from being able to operate the portal. Stanley becomes upset at his brother for telling him to move all the way to the other side of the world after they had just met for the first time in ten years. After Stanley almost burned the first journal with a lighter, the two begin to fight over the journal. Stanley's back was burned on the portal's control console in the process, resulting in him getting his "tattoo." The portal ends up accidentally activating and Stanford got too close to it, getting sucked in. He throws the first journal to Stanley just before the portal shuts off, trapping Stanford in another dimension.
Stanley tried to find ways to reactivate the portal, but couldn't without the other two journals. Eventually, Stanley ran out of food and went into town. He tried to buy some food but had no money. When the people inside the store noticed him and believed he was Stanford, they asked if he gave tours of his house, which was legendary for the strange things inside. Stanley agreed to give people tours in order to gain money and assumed his brother's identity, Stanford Pines, to do so. He also faked his own death in a car crash to further bury his old identity and his past. The Murder Hut, later renamed to the Mystery Shack, became a success over the years, but every night, Stan tried to re-activate the portal to get his brother back. Stan also admitted that he had to lie to everyone in town (including the twins) over the past few years, as he couldn't risk anyone learning the truth about the portal. Covering Ford's mortgage allowed Stan to keep the property, and by extension the portal, under his control and intact. Losing the portal would have meant forever losing any chance of getting Ford back.
Realizing now that Stan was just trying to save Ford, Dipper apologizes to Stan for his disbelief towards him, and Stan forgives him. Unfortunately, the government agents overhear the gang talking downstairs and are about to head down toward the basement. Soos claims that he forgot about the government agents, which reminds Dipper that he still has Old Man McGucket's memory eraser. Ford uses the device to make a sound wave that wipes the memory of the government agents. He then pretends to be a government official and tells the government agents that the readings they got were just radiation from an unreported meteor shower, and tells them to leave. After the agents leave, Dipper and Mabel express their gratitude towards Ford, and Dipper get prepared to ask the "2 billion questions" he has for Ford, but Stan tells the twins to go to bed, much to the twins' disapproval. Soos then slides off to call Wendy about the events that had occurred.
Later that night, Stan and Ford look themselves over in a mirror, pondering how much they've changed over the years. Ford then proposes a deal: Stan can stay for the summer to watch Dipper and Mabel while Ford stays in the basement; but when the summer is over, Stan must give Ford his house and name back, and the Mystery Shack must be closed for good. Stan bitterly agrees on one condition: Ford must stay away from the twins as he doesn't want them in danger and he claims them to be the only family he has left. Mabel, who was eavesdropping, is concerned and asks Dipper to promise that they won't turn against each other in the future, which he does, but Mabel is still uneasy about it as she lies awake and Dipper goes to sleep.
As the credits roll, Soos is still seen talking to Wendy on the phone about the two Stans at three in the morning.