Cradle cap — technically infantile seborrheic dermatitis — is what happens when your newborn's oil glands go into overdrive. Maternal hormones still circulating in your baby's system after birth kick the sebaceous glands on the scalp into gear, producing way more oil than necessary. This excess oil traps dead skin cells on the surface instead of letting them shed normally, forming the characteristic thick, greasy, yellowish scales.
It is extremely common — some estimates suggest up to 70% of babies develop some degree of cradle cap in their first three months. It is not caused by poor hygiene, allergies, or anything you did wrong. It is a temporary consequence of your baby's body adjusting to life outside the womb.
The most important thing to know: cradle cap does not itch, does not hurt, and does not bother your baby in any way. It bothers you because it looks unpleasant, especially in photos. That is a completely valid reason to want to deal with it, but it helps to know that from your baby's perspective, nothing is wrong.