Artists of yore deliberately chose to paint in caves’ darkest, narrowest recesses. Now researchers think they know the reason.