There is a difference between institutional/organized religion and popular religion. What religious texts and institutions describe as religion in the abstract can be very different than how the average person on the ground, or an ignorant layman, practices religion.

It is very possible that the institution contains shirk or kufr whereas the popular practice of it does not. An example in Protestant Christianity is that almost all Protestant Churches teach Tritiarianism whereas many Christians believe in Monotheism. Another example is with Twelver Shi’ism, where the majority of Shi’a laity do not hold the beliefs of the scholarly class.

It is also possible that the institution contains correct doctrines and practices which are misunderstood or otherwise totally neglected by the laity.

Therefore, a distinction between the ‘ulama (institution) and the layman (popular) has to be sophisticated when dealing with groups. It should also be noted that, over time, the institutions progress and the laity progresses through different ideas/practices – and that these progressions can be divergent, convergent, occur at different speeds, or even lead to different sects.