Many adventure authors assume that players are going to have the key bases covered: a tank-y fighter type, a nimble rogue type with a lot of skills, a healer, and a blasting spellcaster. These follow from the core classes of fighter, rogue, cleric, and wizard, but there are many combinations that make up a balanced group like this (and some classes, like an oracle, can do nearly any of them depending on specializations). 

This leads into a few suppositions that adventure authors make: that PCs will be able to fly, although not for long periods of time, at level 5. That's also the level they can reliably move some punitive conditions such as blindness, poisons, diseases, and curses. PCs can bring others back from the dead at level 9 (and can teleport, although not regularly or reliably, then). PCs can flexibly handle even oppressively punitive environments like soul-draining negative energy, by level 17, when they can fling wishes and miracles around. These power benchmarks make good adventure benchmarks, and you see them a lot: steep cliffs at the lower mid levels, more overtly lethal traps in the later mid levels, and bizarre environments are the norm at high levels.

But what if the PCs don't fit the usual mold? A healer role filled by a particularly healing-focused paladin might not ever be able to remove debilitating conditions or raise the dead. If the blasting spellcaster is a warlock, tricks outside of strictly dealing damage (such as making someone fly or teleporting) might be unavailable. This is particularly the case in organized play scenarios, when an author can't make any assumptions at all about which PCs might show up at the table; I used to joke that we needed to write for a table of half-elf bard/monks just in case that's who came by.

Both the "PC fits the role but not perfectly" issue and the "never know which players you'll have" issue are usually solved with magic items. A potion of fly in a cache of treasure prior to reaching the Wailing Cliff means that somebody's going to be able to fly up there, even if none of the PCs are ready to do so. Potions of neutralize poison might appear just before a nasty fight with a monstrous spider, and an ointment that turns stone to flesh might appear prior to a fight with a medusa or basilisk. 

Particularly prepared PCs take some care to have these types of items on hand for any danger that might befall them. I had a friend who circulated a "cheaper than a raise dead" kit that contained all sorts of preparatory and restorative gear to keep PCs up and fighting in a variety of different circumstances (and was, as promised, cheaper than the 5,000 gp or so of getting raise dead cast on your corpse). I took this idea in developing "contingency kits" in Pathfinder, which have gotten some expansion and reprints in other products. These focus on one type of problem you foresee and give you the tools to solve it, such as recovering from an undead attack or getting stranded on some other plane.

These are great tools to have, but adventure authors can't assume PCs have them, so it's generally incumbent upon the adventure authors to seed the right items in the adventure, as I described above.

But here's the rub: canny players know that adventure authors do this, and they get super suspicious when they start seeing a lot of different ways to turn stone back into flesh just before they enter the Cave of Statues, for example. They'll debate what sort of monster requires all this build-up (or "hand-holding," if they're bristling at feeling coddled), and prepare themselves accordingly. In fact, they might prepare themselves so well that they don't need the carefully-seeded equipment at all--such as by preparing reflective surfaces before entering the Cave of Shadows.

So if PCs know what adventure authors are doing, what are adventure authors to do? Here are a few thoughts:

Conceal the Benefits. The PCs might encounter a magic fountain that heals their wounds; they might not know that it also removes poisons. When they fight a nest of wyverns and, badly injured and badly poisoned, they retreat to the fountain to heal their injuries, they also get their poison tended as well. That's a nice surprise for them, prepares them for more fights that day, and doesn't telegraph the dangers that are coming.

Make the Benefits Flexible. One good "prep tool" for the PCs is a helpful NPC cleric, particularly if they don't have one of their own. That means they have access to all the restorative magic for the level, but just have to wait a bit for it. If the PCs rescue a cleric from the Dungeon of Limb Lopping, the grateful cleric is certain to prepare regenerate spells to restore the PCs. If one of the PCs also got blinded and poisoned from the Acidic Poison Spray trap in the Dungeon of Limb Lopping, the NPC can also prepare remove blindness and neutralize poison as thanks. There's a benefit to cultivating a cleric NPC the PCs can use "back in town;" it means they have to make some travel from their dungeon/caves/wilderness to get there, and they might have to give up some treasure, but that NPC can fill the role of providing the restorations. I look to provide NPCs like this in adventures, when reasonable.

Lean Into Telegraphing. This is often my preference. It's actually not bad if the PCs find a bunch of un-petrifying gear, piece the clues together, and are better prepared for an upcoming fight. That makes them feel smart and effective. If it means they end up with more scrolls of stone to flesh than they ever use after clearing out the Cave of Statues, that just makes them more prepared for the next petrifying foe--which makes them feel smart and effective again for having the right gear.