Some of the exams I took in university were of the variety that I thought of as the "measuring how far you could crawl up the beach to safety" type. The one-celled organisms that survived were the ones that had the genes, etc. to make them survive. Why did they have the genes necessary? Luck. That, to me, is what natural selection is.
Some of the trees nearby are several thousand years old. They didn't make the right decisions in life, they just had the "programming" that allowed them to live that long if chances went their way, even to being the right seed landing in the right spot. We speak of things in such a way, but from our own experience, we know that doing the right thing at the right time when life and limb are at stake is almost always a matter of circumstances, not "intelligence". You were trained and went automatic; you panicked, then turned and braked the right way; but for being startled by that dog wandering the road, you'd never have seen dog nor person that you didn't hit as a result of seeing...
Intelligence, foolish or not, is when you test a possibly live-wire before you touch it: with the back of your hand so that any electrically caused involuntary muscle contraction pulls your hand out of contact (foolish?), or with a suitable voltmeter (not foolish?).
With the advent of LLMs which do such a good job of mimicking intelligence, like many others, I wonder if we constitute a carbon-based LLM. I watch my husband's dogs solve problems, learn behaviors, solve access to the cabinet door behind which we keep the bin, open a door latch, remember that "crate" means get in the crate and get a tasty reward, etc. We, as intelligent beings, cannot consciously form a family of useful proteins out of meat and cabbage, but our bodies can. We certainly did not choose that system, it chose us. Or rather, a near infinity of different events formed us.
Apparently, I'm trying to make up for not posting much recently, since I've been rambling.