The Borg attack Earth. They engage a whole fleet, which is driven back to Earth's orbit. Just when the battle seems over, with the admirals ship destroyed and the Defiant (of ST DS9 fame) having no weapons or shields, and the fleet getting systematically destroyed, the Enterprise shows up and helps destroy the Borg Cube. However, the Borg have a plan B.
The Borg go back in time to assimilate earth before our First Contact. But the Enterprise follows and tries to stop them.
Specifically, the Borg want to prevent Zephram Cochran from testing the first warp engine. Because when he engages it in a certain time frame, a passing Vulcan ship stops to investigate and makes First Contact with us. So Picard, Riker, Troi, and the rest have to stop the Borg to save Starfleet, the Federation, and all homosapiens from life as a drone.