As intelligence appears to provide an advantage to survival, I wonder if all animals show a tendency to evolve greater intelligence over time. For example, over the past few hundred thousand years, cheetahs and antelopes have been locked in a constant arms race but neither has chosen to evolve a bigger brain or, presumably, greater intelligence. Even though it is one option open to their evolution, and hence their ability to capture or evade the other, evolution has selected not to exercise it. Yet there does appear to have been an increase in intelligence over the last few hundred million years. Mammals are more intelligent than fish, fish are more intelligent than crustaceans.
Bigger animals have bigger brains with more neurons.
More neurons are needed to control their larger muscle mass and to collect data from their extra sensors. It seems that one side effect of having a bigger brain is to be more intelligent. Perhaps this is because the number of possible interconnections between neurons rises as the square of the number of neurons. So it seems that evolution has led to increasing intelligence simply because it has led to increasing body size. Vertebrates can be bigger than insects and nematodes because, among other adaptations, they have internal skeletons and oxygen-carrying blood.