Some kids just sleep better. I never saw a pattern other than some kids sleep, and some don’t.
I have one kid that loves to cuddle and sleep by someone and has been that way since birth, and another kid who wants to be left alone, and even as a baby hated being rocked, and wanted to go straight to the crib.