There are many hypotheses as to why rock art came to be, and some are more credible than others. However, I do not think that any of these theories has really captured the full story yet. Instead, I think that a bit of theory mixing and matching is required to fully capture what was going on.
Initially, I thought the language theory seemed plausible, but then I realized that theory meant a written language, like hieroglyphs. There is not enough consistency in the works nor is the art placed a fashion where it could be read coherently, so that does not seem plausible. Alternatively, I believe that some rock art depicts a story of sorts, like a picture book. For example a depiction of a speared animal and a horizontal stick-human may be depicting a particularly hard kill in which someone died. This not only tells a story, but it is a memorial for the dead person, and could serve as a lesson-teacher.
However, I do not believe all rock art was used for storytelling. In other cases, art may have been used as part of a religious ritual. This art might have depicted the animal they were hoping to kill, or show how they planned on killing an animal. Thus, you have sites for rituals of increase and for hunting magic. Similarly, rock art may have also marked gathering locations were certain animals were almost always present.
The fact that feet and hands, particularly of children, have been found at some sites also demonstrates that certain sites may have been used for initiation or as shamanistic vision sites. As you can tell, I think different sites were used for different things. When one main site has a lot of art with other places within a reasonable difference depicting very little, it seems possible. In this case, there may have been one site for initiation and rituals, and other sites near hunting grounds that marked them or were used for hunting magic.
In any case, the art that was produced is oftentimes very detailed, including coloring, shading, and musculature. This suggests that the brain was changing, allowing “us” to better conceptualize spatially and depict our thoughts. The detail also shows that art must have been valued because food was scarce and death was a weekly occurrence, yet people were taking time to document life, send drawn “prayers,” and holding rituals.