For some kids their bladder hasn’t yet learnt to really stretch enough to hold big amounts of urine during the day, so at night their bladder can’t stretch enough to hold all the wee it needs to stay dry. In other kids, their kidneys make too much urine at night as their brain connection hasn’t learnt to slow down.
This is called Enuresis, primary if the bladder has no control and secondary when the child is often dry then suddenly wets again. In boys the urethral valve can be dysfunctional or too elongated but as they get older this corrects itself.
Certainly by the age of two years, two out of three children have the odd bed wetting nights, but by five years old about ten per cent of kids still bed wet and around two per cent up to the age of fiveteen. Nervous control of the bladder in childhood is variable but reacting or dishing out punishment doesn’t work. Anxiety will just increase the incidence and you as the parent will only end up feeling guilty. So what are the solutions? More in the main article.