A robot may have a planned route, but the real world puts unexpected things in the way: a person steps out, an object has been moved. Obstacle avoidance is the fast, reactive layer that senses something in the path and adjusts immediately, slowing, stopping or steering around it.
It works on a shorter timescale than route planning, reacting to what is directly ahead rather than reconsidering the whole journey. The balance is between caution and progress, since a robot that freezes at every shadow is useless, while one that reacts too late is dangerous.