Twilight must be looking for the pony equivalent of mitochondrial Eve, because when Pinkie surprises her in the library she's researching genealogy. Pinkie takes a scroll from the bottom of the Jenga tower Spike constructed, reads it, and discovers something wonderful: she's related to Apple Jack! As the only two Earth Ponies in the Mane Six, this is kind of like two German-Americans from the same town in Ohio discovering they are fourth cousins. (In case you were wondering, everyone in Ohio is related. Everyone.) Her discovery would have been more earth-shattering if we found out she was related to Fluttershy or something.
All the Apples are excited to welcome Pinkie into their family, proudly proclaiming they are the best clan around. (Aside: is Apple Jack’s full name “Apple Jack Apple?” That’s like being named Hugh Hughes.) It is worth noting just how damn adorable Apple Bloom is, because it's a lot. Apple Jack, being the sensible one, wants to check the facts before completely welcoming Pinkie to the family (she probably figures it’s big enough as it stands). The scroll detailing their family connection is slightly smudged at the bottom, so they decide to road trip to visit Golden Delicious (the Apple family historian).
While Pinkie is gathering her things for the trip, Apple Jack reminds her family to be on their best behavior until they are certain that Pinkie is an Apple, because it’s important for outsiders to believe you’re perfect and have no unrealistic expectations upon entering the family. After all the song and dance cracks in the family relations begin to emerge, because as it turns out, no family is exactly Kodak-worthy 100% of the time. Macintosh overpacked the cart, so it collapses on the road. Pinkie suggests they raft down the river to Golden Delicious's, and Granny Smith helpfully suggests they glue together parts of the cart into a makeshift raft.
Predictably, things start to go downhill (downriver?) quickly. Apple Bloom accidentally sends the map overboard, which leads to Granny Smith leading them down the wrong bend in the river and through the scariest cave in Equestria. Apple Jack argues with Granny over driving (which is reasonable, seeing as Granny must be approximately twelve billion years old), breaking the steering wheel in the process. Naturally, Pinkie is documenting this with her camera throughout. If you've seen “A Goofy Movie”, the next part is familiar: the raft, and the Apple family therein, goes over a waterfall.
They survive, probably thanks to Pinkie's mastery of physics, and make it to Golden Delicious's house. The Apples apologize to each other for behaving so poorly. They agree that Pinkie should not feel obligated to be a part of such an imperfect family. Pinkie overhears and points out that they're not just a family, but friends too because they are willing to overcome disagreements and differences. Now she's even more eager to be part of the family.
Golden Delicious, who is possibly even older than Granny Smith, arrives and lets them into her home. The Equestrian version of “Hoarders” needs to get here ASAP – the old pony clearly has an animal and “heirloom” hoarding issue. How many dead cats could be found in an old banjo case? How often have you seen a pile of dust shaped exactly like a cat? After hastily cleaning a path into the house, Golden Delicious finds the book containing the Apple genealogy. Unfortunately, she is unable to determine if Pinkie is truly related to them because the page is smudged. Are you sensing a pattern? I'm sensing a pattern, probably perpetrated by Equestria's own Tom Bombadil: Pinkie Pie.
Apple Jack declares that she doesn't care what the paper says, Pinkie is part of their family. And then everyone hugs. Friendship (and family) is magic!