Dogs allowed to roam free in rural areas will sometimes kill and eat small wild animals, thereby acquiring intestinal worm infestations. This can cause them to vomit in the night. Not every dog in that situation, but some, will then eat their own vomit, now-dead worms and all, when they wake in the morning.
Woke to find that Harley had already made his own dog's breakfast - puked up that rabbit he caught, plus some roundworms, and was re-eating the whole mess off the floor in the summer kitchen, by the wood stove.