For example, our shrew like ancestors that survived the KT extinction most probably did so because they were very small & could hide in underground burrows, eating tubers & worms, not because they were all that clever. Equally, a clever T-rex would've perished with all the rest. So I think maybe one factor in favouring intelligence is a sufficiently calm environment - not too calm, cos you need to mix things up a bit, but not so disruptive that physical adaptability trumps intellectual adaptability. It would make sense to me that you need a long period of only moderate environmental changes to allow intelligence to be selected for, and to finally reach the point where the creature is intelligent enough to overcome environmental shifts that its physiology alone couldn't cope with - such as modern humans.
Evolution has been sometime described as "long periods of boredom punctuated by short periods of terror"(originally about war)
However the KT is still a little controversial with some going for the Deccan Traps caused hyperthermal that was underway as a cause and others going for the "press push" model that the two combined to hammer the big species.
While some burrowers got through it, so did crocodiles and birds. The mammals that got through were likely a bit bigger than shrews. They did not actual dominate afterwards, birds seemed to have done best, mammals kicked on during the Eocene.
Earths evolution seems to be that after long periods of diversification you get a big wipe out event and an new restarting. This seems to wipe clean the large animals and allows the smaller ones who have made "the most" progress to take the mantle of dominant vertebrate life form, this is what happened to allow dinosaurs after the Permian Triassic uber die off.
There is a theory that Earths rock weathering\carbon system is critical here. We have had a remarkably stable climate in spite of the Suns energy increasing about 30%. Mostly liquid water. Much\most\all of the planet froze during the Cryogenian when ice sheets reached the equator. When that ended during the Ediacaran we see the first multi cellular life, that is followed with that multi-cellular life developing hard parts and sensors in the Cambrian leading the famous Cambrian explosion.
Then over the next 520 million years we see life diversify and radiate before disaster strikes, often related to the carbon cycle heating or cooling the planet, then more diversification and increasing complexity of nervous systems. This is sometimes talked about as an evolutionary pump.
We think we see a miniversion of it over the past 3million years as the swings from glacial to interglacial created a constant flux of niches that the upright apes became adept at exploiting by carrying their massively over specced brains.
Till BOOM about 70 000 years ago modern behaviour arrives and everything goes into over drive.
A plant whose crust is just perfect for continents above an ocean, enough vulcansity for a cabron cycle to regulate temperatures for 4.5 billion years but enough variability to create the pump, stabilising uber companion in the Moon, gas giant that swallows most stray asteroids in Jupiter and a whole host of over stars may have come into alignment to make this the perfect biological laboratory for "punctuated equilibrium" evolution.
Over our life times we will have many more answers. But is one hell of a journey finding out.