Wouldn’t those early months of new parenting be way easier if babies didn’t wake up to breastfeed in the middle of the night? Well, there are a few reasons why baby wakes up at night, one of which is to make sure they’re getting enough to eat for their growing bodies and brains. But understanding why night wakings happen and how they can benefit you both can help bring some peace of mind—and make those night wakings a little easier to take for bleary-eyed parents.

Here are 5 reasons why it’s actually a good thing your baby wakes up at night

1. Night wakings help you make more milk

Babies are smart! At night and particularly in the wee hours, the milk-making hormone prolactin spikes and leads to more breast milk production. Prolactin starts to ramp up as the day progresses, and babies quickly figure this out and realize that waking at this time benefits them. (If you’re wondering whether babies can smell breast milk at night, the answer is yes!) In addition, breast milk is higher in fat content during this nighttime hours, too, which is great for your little one’s fast-developing brain.

Related: Breast milk is basically magical, science says

2. They help your little one become a better sleeper

This one may be a tough one to believe, especially if you’re nursing an older baby who you feel should be sleeping longer stretches by now. (Wondering when baby will start to sleep through the night? Research has the answer.) However, breast milk produced at night actually promotes better long-term sleep! Who knew?

Since babies don’t produce melatonin—the sleep inducing hormone—for most of their early life, falling and staying asleep doesn’t come easy to them. But what does contain lots of melatonin? You got it—breast milk.

Related: 6 secrets I’ve learned as a baby sleep consultant

The great thing is that melatonin in nighttime breast milk can help regulate a baby’s circadian cycle (the body’s clock which regulates sleep-wake cycles) and allows them to eventually learn to sleep longer stretches at night.

3. They encourage tryptophan consumption

In addition to melatonin in nighttime breastmilk, tryptophan, a sleep-inducing amino acid, is also found in human milk. It’s also a precursor to melatonin and serotonin. During infancy, ingesting tryptophan leads to more serotonin receptor sites in the brain. Plus we know that serotonin makes the brain work better, keeps one in a good mood, and helps with sleep-wake cycles.

Related: 8 ways to fix your baby’s short naps, according to a baby sleep expert

4. They extend breastfeeding duration

Mothers who breastfeed at night are more likely to breastfeed for longer because production remains more steady. This goes back to the basic breastfeeding principle of supply and demand. The more times the breasts are emptied in 24 hours, the more milk a mother will produce, and the longer she can maintain her established supply.

Related: AAP now recommends breastfeeding beyond age 2 due to benefits both for baby and mother

5. Night wakings help you get more sleep, mama

No typos here… you read correctly. Mothers who breastfeed get more sleep at night because oxytocin, known as the love hormone and the one that helps moms feel relaxed while nursing, contributes to better sleep—and can help you fall back asleep faster after nursing. Any extra sleep not only helps mothers feel better but also decreases the chances of experiencing postpartum depression.

Keep these in mind the next time you’re up during a late-night feeding session. You’re doing something great for your baby and yourself.

Related: Here’s what a sleep expert says about nursing your baby to sleep.

A version of this story was published October 9, 2017. It has been updated.