How can the judiciary distinguish between superstition and genuine religious practice?

The Supreme Court is hearing the Sabarimala women entry case, which raises questions about what constitutes superstition versus a legitimate religious practice. I want to understand how courts can make such distinctions without undermining religious freedom.