Every animal has some good bacteria in their guts that help digest and utilise the food they eat. Over a period of time, these bacteria get accustomed to our diet. When we eat something different or change our diets suddenly, these bacteria tend to get thrown off balance- causing tummy upsets.
In nature, animals would eat lots of different things, allowing their gut bacteria to adapt and be quite resilient. However, our pets' diets can be pretty standard and entirely dependent on what we decide to feed them. This makes the gut bacteria delicate. So tiny changes can also wreak havoc. Of course, some animals are more sensitive to these changes than others, especially very young puppies.
It is almost certain that throughout our dogs' lives, we will make changes to their diets. This may be because their nutritional needs change as they grow or because a particular brand of pet food is no longer available. It could also be a switch from kibble to wet dog food or fresh food. Whether the changes you make are big or small, you should try and give your dog's body enough time to adjust to these changes. This can be easily done by transitioning meals instead of suddenly changing them.