The use of random encounters as a type-of "clock" is one well-known use case.It depends on the game. If I'm running an OSR-style game, where resource attrition is meant to be part of the challenge, I do. Otherwise, I can't think of a gaming style I use where it would be appropriate.
The other, though, is as a type of "world simulation". At least as I understand and approach them, this is the role of random encounters in Classic Traveller and of events in Torchbearer 2e. To borrow some language from Apocalypse World, it's a way for the GM to "disown" the framing of a scene.
In practice, I have found the TB2e events pretty fun and effective. The Classic Traveller encounters, on the other hand, tend to serve more as a type of formal constraint on GM creativity: like, now it's time for me to frame a scene, and it has to include <this> - where "<this>" is the result of the encounter roll. That's because (unlike the TB2e tables) the Traveller tables don't bring stakes/motivations with them. So I, as GM, still have to inject those into the scene.