The Bozeman was caught in a time loop for 80 years. The crew didn't know they were in a time loop all that time because they were doing the exact same thing each time before the reset. The variable was the Enterprise, which wandered into the area of space where the Bozeman's time loop was happening. The Enterprise was then part of the time loop as well, but unlike the Bozeman's crew, experiences for them each time were different, and they were able to figure out the problem. However, I'm not quite sure why avoiding the collision would have brought the Bozeman out of its time loop.