When Voyager was a shiny new probe just heading out back in 1977 (or Pioneer, Apollo, or really anything else we've sent beyond low earth orbit) it didn't have the ability to avoid hazards. It's trajectory was more-or-less fixed the moment the Titan booster cut it loose.
The fuel it carried was for course corrections - gentle nudges to go past Jupiter at just the right angle to get to Saturn in a few years. Yes, we could consider Jupiter to be a hazard it avoided but moon-size and larger hazards are very predictable - the Titan profile considered all of that.
True hazards, the ones that pop up without planning, come in "dust speck" and "rocks and larger" categories. We have nothing, even today, to detect dust specks coming toward us at spacecraft speeds and rocks would need to be pretty big to notice 24+ hours before collision. You need that much time to collect sensor data, return it to earth, analyze it, predict a collision, program a maneuver to avoid the collision, send it to the spacecraft and fire the thrusters to nudge it out of the way. You can't do this just-in-time without pretty big fuel reserves, but if you see it far enough out you only need 1 Newton in the right direction to avoid it.
Every spacecraft gets hit by dust. If it takes a big particle (say, 1mm) in something critical that component is dead. 1 gram at LEO speeds produces 22,000 joules on impact - this is more than a .50BMG round point-blank, and that round can split a truck engine in half. Rises to 144,000 Joules at Voyager's speed. That's a 30mm cannon round.
if it gets hit by an impossible-to-see-coming apple-sized object, it's space junk.