Your employer will notify the pension fund when your marital status changes from «single» to «married». At this time, your current total pension savings will be recorded. This also applies for registered partnerships.
When you decide to go your different ways
You were already paying into your pension fund before you got married. This money is still yours, even if you and your partner go your different ways. That is why the pension fund records your vested benefits on the date you get married or enter into a registered partnership. Should you and your spouse separate, the contributions you both made during your marriage are usually divided equally between the two of you.
Of course, it is nicer when you and your partner stay together «until death do you part». Then you do not have to worry about how to split your pension savings. By the way: if you change your pension fund while you are married, your relationship status is automatically sent to the new pension fund.