Diatomaceous earth is crumbled fossil creatures (called diatoms). It looks like a white powder, but each particle has a sharp surface that is capable of lacerating the body of pests like slugs and snails, thereby killing the pest. It is also a dessicant, and can make the ground inimical to the life cycle of fleas (by dessicating their eggs). Therefore, it is a pesticide, not an herbicide.