The chinese wanted to make the dog resemble the lion, and would smack their muzzles "flat" Years and years of this leads to the flatness of the muzzle. I am not 100% that this is truth, however I have seen it mentioned on many occasions.
Another "myth" is that somehow they were bred with a monkey, which explains the bowed legs. But that is actually found in a book of myths. The muzzle part, I have seen elsewhere & cannot actually find that in myths.
If you think about it, I suppose actually smacking their muzzle over all those years can indeed change the way they look. I mean, didn't the American Bulldog actually have similar when all the years of docking their tail, many are born without tails now adays?? Kinda the same, but not lol..