There are many use cases where collision detection is detected too late in a game. Let's consider a case, in a game, where we have a door and if the player approaches it, you want the door to open automatically. If we use collision detection for this case, then the player has to first collide with the door, in order to open it; or alternatively, you can create a bigger bounding box (a rigid body with more depth) so that when the user approaches the door a collision is detected earlier. However, this approach does not cover the use case of the player not facing the door. For instance, if the player has its back towards the door, then a collision would be detected and the door would open. Collision detection does not consider directions.
Ray casting is also used to build the basic AI of a non-playing character. A moving player might need to alter its direction or speed automatically when there is another existing object moving in the same direction...