The body size of a dog is controlled by about 20 different genes. In purebred breeds, most puppies are fairly consistent in size because each breed has been (intentionally or not) selected for specific genetic variants for size. When breeds are mixed -- especially in dogs with many breeds -- it’s a bit of a lottery.
This means a dog with mostly large breed ancestors can inherit more body size variants from just one small breed in their ancestry or vice versa. This is why mixed breed litters can have a lot of size diversity!