Foundation Prime is the center of the multiverse, wherein one can travel to any universe that is a part of it, including the universe inhabited by Emmett Brown, Marty McFly, and their friends and family.
In 2015, Lord Vortech discovered Foundation Prime. He began searching for the foundation elements that would allow him to take over all of the dimensions in the multiverse. As Doc's flux capacitor was one of these elements, Lord Vortech's former companion, X-PO, summoned Doc Brown and Marty McFly through the portal to Vorton so they could help defeat him. As a result, Doc and Marty met many people from other universes.
Lord Vortech traveled back to January 1, 1885 to fetch the flux capacitor when Doc first arrived in that era after the DeLorean time machine was struck by lightning in 1955. Batman, Gandalf, and Wyld Style traveled through the portal to stop him. After helping Seamus McFly, Hubert, Joe Statler, and the Hill Valley Railroad Station ticket officer, Doc arrived in the time machine. They helped clear a path for Doc so that he could hide the time machine, before the townsfolk saw it, at the Delgado Mine.
Doc's worries about future technology in the past would soon become much more of a reality, once Lord Vortech appeared. During the ensuing battle, he summoned many items from the future in an attempt to block their path. One of the items of future technology that came through a portal was a hover converted DeLorean, piloted by Marty McFly, which hit Lord Vortech upon entry.
After the battle ended, and everyone else left through the portal, Marty realized that the items from the future were still there, and jokingly asked Doc what he did to the space-time continuum. Doc responded that he hadn't done anything yet, and suggested that to fix it they head back to the future.
Marty and Doc arrived in the 21st century and were taken through a portal to Foundation Prime. They aided in the final battle against Lord Vortech, who was defeated and placed in a prison dimension, restoring the multiverse.