I'm dumb and don't know anything about maternity/paternity leave. What prevents someone from being hired by a company, taking leave due to a child in X days, taking the salary the government forces the company to give you, and quitting Y days after you return? What if X and Y are a month or even one day? Could companies could be scammed for a year of salary while getting only a few days of value out of their employee…
However, it is a quite common employee benefit, that the employer pays full salary for part of or for the entire parental leave. The employer is then reimbursed from the government for the first 2k€ every month.
Nothing prevents you from quitting when you get back from parental leave. Except that you probably already have a lot on your mind with a little child - why add the extra pressure of switching jobs?