Chapter 4.2 of the book of the text discusses the relative importance or "nature" and "nurture." According to studies, both nature and nurture influence religiosity, but the relative importance of each differs by the type of religiosity. In particular, religious affiliation tends to be more stable and influenced by one's parents throughout one's life than church attendance.
Consider one way this pattern is manifested. Suppose an individual grows up in a religious household, takes upon themselves the religious identification of their parents, and is a regular participant in the activities of their parents' religious group throughout their childhood. As they advance through adulthood, their interest in religion declines. Although they continue to maintain their identification with the same religious group. they rarely participate in church activities. That is, they originally inherited the "belonging" and "behaving" of their parents as a child but now have an adult have only retained the "belonging."
Why would this pattern come to realization? Some simple cost-benefit analysis of an example can provide a clue.
First consider the affiliation decision. There are probably some benefits to an individual to retaining their religious affiliation, while there is little benefit to switching. By keeping their identification, they keep their parents happy to an extent. They can also attend church with their parents on major holidays, thereby maintaining some family cohesion. But it is also the case that keeping the religious identification does not involve any costly action. Although it will differ across individuals, retaining their identification can involve as little as periodic verbal acknowledgement of their affiliation in conversation. So even if there are relatively few benefits for retaining the affiliation, having a little cost to retaining the affiliation means that a person can retain their inherited affiliation for a long period of time without much pressure to change.
The church-attendance decision is quite different. Attending in any given week involves clear costs because the time spent at church can be spent on so many other activities -- sleeping, exercising, studying, earning money, practicing a hobby, enjoying time with friends, streaming a movie online, and so on. Time-allocation decisions are frequent and regular with pretty clear costs. So even though the decision to attend any particular week might seem to be a less significant decision than the decision of one's religious affiliation, the fact that there are clear and obvious costs to attending church means that the decline in religious participation may occur more steadily with a decline in religious demand and long before a change -- if any -- in religious affiliation.
This simple analysis illustrates one of the reasons why religiosity is complex, namely, that the costs and benefits of different types of religiosity can change in different ways, and this can result in different trends in those different types of religiosity even for the same individual.