The best way to understand why 30 dogs got kicked out on the 30^{th} morning is to simplify. Greatly simplify.

Imagine the case where there is only one dog stealing. In this scenario, 99 villagers see one dog stealing, and the only person who doesn’t see any stealing dog realizes that the thief must be HIS dog, so he kicks out his dog the next morning.

How about the case when there are 2 dogs stealing? Well, 98 villagers see 2 dogs stealing, and 2 villagers see 1 dog stealing. After the first morning, no dog gets kicked out. That night, the two villagers both realize that since they only see one dog stealing and no dog got kicked out, the only scenario that makes sense is that their own dog must be stealing. So the 2^{nd} morning, both kick out their dog out of the village.

The case of 3 dogs stealing goes the same way. 97 villagers see 3 dogs stealing, and 3 villagers see 2 dogs stealing. After the 2^{nd} morning passes with no action, the 3 villagers are now aware that their dog is stealing, because otherwise 2 dogs would have been kicked out (see case above). So the 3^{rd} morning, 3 dogs get kicked out.

You can see that the logic continues in the same fashion for 30 dogs. On the 29^{th} morning, after no dogs are kicked out, 30 villagers are now sure that their dogs are stealing, and kick them out of the village on the 30^{th} morning.

That was not an easy question, but hopefully the explanation above makes sense. A much more difficult question remains: What *additional information* was given by the factory boss to solve this problem?