Generally, society tries to separate people who do terrible things into categories (sad, bad or mad). It's deeply uncomfortable to accept that people can do such awful things just because they are 'bad' (especially women, where we have been conditioned to think of women as caring and loving) so we swing to them being 'mad' (some sort of psychosis which means that they can't be responsible for their actions and would never have ordinarily behaved this way) or 'sad' (so depressed that they couldn't see another way forward).
We may never know the truth, but professionals will have assessed the mental state of the mother to contribute to the trial and sentencing process.
I think SS are unlikely to have been able to act because the previous 'illness' of the first child who died would have seemed to be a precursor to her death, so until the postmortem showed compressive injuries, there was no suspicion. It's hindsight that gives clarity, sadly