Babies and small children don't understand cause and effect. The only way they learn is by memory/imitation.
If they are trained that crying before bed brings mommy that is what they will do!
Train them that when they are put into bed the only way out is when the sun is shining. They are fast learners.