The term “pillar 3b” just denotes private providence. It pretty much means any savings or insurance which isn’t tax-preferred (pillar 1, pillar 2, pillar 3a).
Insurance is the only product which is actively marketed using the “pillar 3b” term. This is to differentiate regular old insurnace from “pillar 3a” insurance which is tax-privileged.
In the case of term life insurance or disability insurance, using the “pillar 3b” variant can make sense (if you want to choose a beneficiary other than your legal heir, or if you already use your full 3a deduction for retirement savings, for example).
In the case of permanent life insurance equity-based insurance with a cash value), using this is suboptimal, whether they are pillar 3a or pillar 3b (or foreign with neither of those designations).
Regarding the tax deduction, there is a tax deduction for combined health and life insurance premiums separate from the pillar 3a. All cantons have this AFAIK. But the deduction is so small that it’s generally taken up completely by your health insurance (in fact, even the cheapest mandatory health insurance available anywhere in Switzerland should use it up, AFAIK). In the unlikely case that you have some of that deduction left over, then you can deduct insurance premiums for pillar 3b insurance there. This is beneficial if you have term life insurance (like I do) or disability insurance (like I don’t).
But do please stay away from pillar 3b permanent life insurance (Kapitalbildende Versicherung, Gemischte Lebensversicherung, Sparversicherung, etc.)