There are clear criteria for who is mandatorily insured. And a certain threshold value plays the decisive role.
Mandatorily insured in occupational pensions are all working employees in Switzerland from a certain minimum salary. This threshold, the so-called entry threshold, ensures that the second pillar takes effect where a relevant earned income is achieved. Anyone who reaches this minimum salary with an employer is automatically insured, first for the risks of death and disability and from age 25 also for retirement saving. So not all persons resident in Switzerland are covered, and not exclusively the self-employed either, who as a matter of principle are not even subject to the mandatory scheme. What matters is the combination of employment and reaching the entry threshold.
This design ensures that occupational pension provision complements the AHV where an employment relationship with a relevant salary exists. For people with lower incomes, part-time work or several small jobs, it is worth looking at one's own situation more closely, because there is scope for arrangement here and sometimes gaps that can be closed.