Without getting into all of the scientific details (I flunked biology,) the researchers screened a group of almost 500 Portuguese water dogs (a breed with lots of size variance,) and sequenced their DNA to identify the differences. They saw that differences in a specific gene had a strong correlation to the size of the dogs. Later, they studied additional breeds, and saw similar patterns. The gene, known as IGF1 (insulin-like growth factor 1,) has also been identified in humans and mice as being a determinant in body size.
Now that this gene has been identified, it’s only a matter of time before some evil genius figures out a way to develop permanently miniaturized versions of large breed dogs that we can carry around in our pocket.