When they see Mario approaching they run in a straight line towards Mario, trying to run into him and bite him. Their attacks can be easily avoided. To defeat them, Mario must ground pound on top of them. They also appear in Super Mario Galaxy 2 in the Puzzle Plank Galaxy. In both games there is a special Mandibug. That Mandibug has a smaller Mandibug on the top of it which is protecting the big Mandibug. That means you have to defeat the smaller Mandibug first and then defeat the big one. After that a star will be revealed.
The name "mandibug" is a transfusion of "mandible" - the scientific name for the jaw - and from "bug".