Doc helps harness the power of a lightning strike so that Marty can travel back to the future. He struggles to make the connection between the wires of the lightning rod so that the lightning will strike Marty's car. When he finally makes the connection, the wire at the other end unplugs, so he rushes to reconnect it. He manages to reconnect the rod the moment the lightning strikes, sending Marty into the future.
In 1955, Doc can't think of a way to generate the 1.21 gigawatts needed to power the DeLorean so Marty can go back to the future. Because Marty has information about the future, they are able to concoct a plan to channel the energy from a lightning bolt into the flux capacitor.
Doc Brown shows Marty his time machine in the DeLorean at the Twin Pines Mall parking lot. Doc tells Marty about the date he invented time travel. He states that the Flux Capacitor is what makes time travel possible.