Well, this is a topic that has had my attention on an doff for decades. It is (as was pointed out above) a major question in anthropology.
One approach I like to take is to view concepts and ideas as items expressing human nature (as primarily temporal beings). By this garbled language I simply mean I find it interesting to view Instinct, Habit and Ritual on a temporal basis.
Instinct has no ‘temporal’ basis as it is not a conscious item for, nor a key feature of, conscious awareness in our ability to segment time.
Habit is something that is of an idealised nature and sets into motion goals that parallel Instincts and/or veer away from them based on wants and needs.
Ritual … I actually think the term is more or less a group of quite varied items.
As stands I have these five items.
1) Perception : Visualising
2) Thought : Articulating
3) Realisation : Acting Out
4) Reversal : Analysing
5) Development : Inventing
The danger going down this road is starting to refer to literally everything as a “ritual” just like some state that “everything is art!” Or some such nonsense. The difference here being I do not see “rituals” as perspectives one can hold to (like one can view the world through the lens of Art) but as something that absconds from any lens gazing in favour of developing an abstract world.
I am not sure that “rituals” need to have a set purpose either. Maybe it is that some forms of “rituals” are more about exploring purpose and/or imbuing purpose by selecting some segment of time and addressing it by Visualising, Articulating, Acting Out, Analysing or Inventing.
A lot of this does tie into several other areas but I think that is a broad enough outline of my thoughts on “ritual” for now.
I have noticed plenty of people declaring something as a ‘ritual’ yet declaring this does not really pin point what differentiates a ritual from other things. I think it is not merely a superstitious behaviour nor has to possess any hint of superstition to it either.