Has this happened to you?

Why do babies start crying out of no where? Especially when theyre sleeping? My baby of 3 MO just did this right now shes never done it before very calm baby. So i put her in her crib she was sleeping then started crying out of nowhere. So i hold her layed her down with me in bed then happens again.

Why does it happen?