Diatomaceous Earth (food grade) is used for many different reasons. Mainly to kill bugs by cracking and drying out their shells. It is an aid in keeping mites and lice at bay buy dusting your chickens and coop with it. You can also add it to the areas where your chickens dust bathe. I also add mine to their food to help keep it dry. It's ok for the chickens to ingest as long as it's Food Grade.
In my coop and run I sprinkle it around and rake it thru to help break down the poop. It's controls odor and flies as well. It's great in the winter sprinkled on poop in a well ventilated coop because it keeps the poop dry which aids in controlling the humidity.
Hope this helps.