The rules for Magic are pretty clear on how this works. Cascade is covered in rule 702.84, with the important part for answering the question in 702.84a (Emphasis mine):
702.84a Cascade is a triggered ability that functions only while the spell with cascade is on the stack. “Cascade” means “When you cast this spell, exile cards from the top of your library until you exile a nonland card whose converted mana cost is less than this spell’s converted mana cost. You may cast that card without paying its mana cost. Then put all cards exiled this way that weren’t cast on the bottom of your library in a random order.”
This shows what kind of ability Cascade is, triggered. The rules for triggered abilities are covered in 603, the important part for this question is 603.3 (Emphasis mine):
603.3 Once an ability has triggered, its controller puts it on the stack as an object that’s not a card the next time a player would receive priority. See rule 117, “Timing and Priority.” The ability becomes the topmost object on the stack. It has the text of the ability that created it, and no other characteristics. It remains on the stack until it’s countered, it resolves, a rule causes it to be removed from the stack, or an effect moves it elsewhere.
And the part in 117 that matters here:
117.3b The active player receives priority after a spell or ability (other than a mana ability) resolves.
Effects that cause a player to search their library are almost always a spell or ability, abilities like Fabled Passage or spells like Demonic Tutor. The active player receives priority only once that spell or ability fully resolves, which always includes shuffling the deck. This means that while the Cascade ability will trigger during the search, it won't be put onto the stack until after the deck is shuffled.
For some tutors, like Worldly Tutor or Vampiric Tutor, this means you will get to chose the spell you cascade into, since those tutors place the found card on top of the searched library, but for most search effects, you will shuffle the full library before the cascade is put on the stack or resolves.