I have no obsessions and few compulsions, but have developed some private rituals, in the sense of fairly invariant procedures that I perform regularly. Rituals, while not strictly religious, serve to comfort and protect us from making mistakes. My most used are going to bed, getting up in the morning, and making coffee. They are fairly complicated, and have alternative paths. I can follow any of the alternative paths, but breaking a ritual can lead to a bad day.
Public and religious rituals can serve a similar purpose at a community level. Citizens who break public ritual often face irrational and extreme ire from others in the community, for example the athletes who express protests during the playing of a national anthem. Here I am using the word 'citizen' to mean simply a recognized member of a community.
Catholics who make the sign of the cross are performing a religious ritual, whether done publicly or privately. Standing with hand over heart during the playing of the national anthem is a public ritual. Public rituals are seldom performed in private, because the performance is primarily intended for others; while private rituals are seldom performed in public. Rituals of all types develop and evolve over time on the basis of circumstances and needs