But what if the cave walls glowing misleads the observer and they get lost further? Then it wouldn't seem to be intelligent. In any case, the light source being intelligent occurs in the context that there is an intelligent observer who may be able to escape easier given a light source. The observer sees the light, evaluates it, and makes a decision. Even if it's just instincts, there is a decision made. What might be intelligence is if the cave (or elements of it) acts according to "this person is lost at this location, so light up this specific pathway". If the cave somehow facilitated more functionality, such as leading a person to clean groundwater, it would be more intelligent. In the context of helping the person escape or aiding them in the meantime, the cave tends towards accidental sophisticated technology ("...[which] is indistinguishable from magic"). Functional intelligence, I'll call it. Then perhaps there could be a theory of intelligent agents, who have goals and plans.
Intelligence is the mitigation of uncertainty.
The revelation of the light is information. Navigating the contours of darkness is intelligence.
If the cave walls glowed in response to proximity (of the observer) then the light source would have a modicum of intelligence.