There is no deterrent.
Of course, it's impossible to stop every potential murder as some will happen no matter the consequences (mental instability, heat of the moment, rage etc).
However, the sheer fact that the girl had the audacity to ask her caregiver "whats the punishment for murder" tells you our justice system isn't even close to getting it right in our society.
Now I bet if the punishment was for example, skinning alive, dipped in acid, boiled alive, or anything else of that severity, there wouldn't be much more than a handful of people who wouldn't know about it let alone risk committing a murder and face those consequences.