You have cancer, the doctor says you have perhaps 2 years to live; but it will be 7 years before you can officially retire?
Second pillar : The pension plan connected to one's employer. Whether or not it pays out benefits is directly dependent upon the decisions of the state social security. If the IV/AI (disability insurance) decrees that the person is disabled , then the pension plan follows that and will also pay out a disability pension. It is payable until attaining old-age, at which point the AHV/AVS (old-age pension) starts, or until death, or until recovery.
Third pillar The 3a account (i.e. private savings outside of the pension plan) is blocked (and one obtains a tax savings by submitting to that block) until either old-age retirement or disability. With the decree of the IV/AI, the person can get the 3a account unblocked and the funds are then freely accessible.
Any 3b savings were never under any restrictions, so are always freely disposable.
Second pillar : If a disabled person recovers then they are once again responsible for earning their own living. The disability pension will fall away and the former employer's pension plan is relieved of that duty. The person, now no longer disabled , will (hopefully!) find employment and then be insured, again, in that new employer's pension plan. In that case, the remaining vested benefits from the first pension plan should be transferred into the second pension plan. If they don't find employment, the vested benefits will be transferred into the special government fund.
Third pillar : Once no longer disabled , the person re-gains access to being able to use a 3a account. They can then start paying in, and deducting that amount from their new tax forms. It will once again, as before their illness, be blocked until either old-age or renewed disability.