These incidents happen most often when you don't normally have the kid. For example, your partner normally takes the kid to daycare but they're under the weather so you take the kid on your way to work, go on autopilot and forget about the kid. And yes, perfectly decent people do this.
Some cars now have alarms that will remind you.
The best thing to do is to put something you need for your next destination, such as your badge to get into work, your phone, etc, next to the child on the back seat. So you can't get into your office without noticing you have a sleeping baby back there. It sounds ridiculous that you would remember your key card and not your child, but it happens. To perfectly sane, decent people who adore their children.
(You should also do this if you are taking your dog to daycare, because this happens to pups too).