This insurance is established by the agreement in which your activity is framed and is of mandatory nature. Not all agreements require their recruitment. You have to know if yours requires it.
Regardless of the number of employees in the company when the insurance is taken out, it covers everyone who is registered in SS2 which is presented at the end of each month relating to the previous month. When the policy expires, it is regularized. Depending on the number of months each worker has been discharged, the corresponding premium is paid. This can result in the company having to pay an additional amount, if it has more workers than at the time of recruitment, or if it has less money back.