THey dont!
I was told that MJ was going to be really big and i had an extra scan - i also carry really big as well (roomy i call it)... MJ wasnt huge, 8 pound 6oz or 3.8kg.
They can only really guess and as the others have said, can be out by loads. A girl in my MG had a 12pound baby, they had NO idea that he was big!