Diatomaceous Earth (DE) is not actually dirt per se; but it is fossilized phytoplankton, and looks like flour when you buy a bag of it. You should always gt the food grade DE, and not the kind that is used for swimming pools.
DE kills most bugs because they have an exo-skeleton, and the DE (which looks like glass shards in the microscope) will scrape and pierce their skeleton, and they will dehydrate and die.
Since it is killing them by a physical means, and not with a chemical, they can never devlop a resistance to DE, and more than a human can develop a resistance to being stabbed with a knife. However, DE is harmless to humans and animals, and it is even good for us to use as a supplement for ourselves and our pets.
Since DE contains silica (which we need to exist), it will give your pet a nicer coat. It makes hair and fingernails grow faster, so many people use it in their smoothies, or put it in juice and add a spoonful or more to their diet every day.