Both males and females will raise their head and spread their jaws to deter predators. It probably works too. But it seems that males actually use those fearful tusks for the purposes of mating, like peacock feathers or deer antlers. It's weird how females are so often attracted to things that are completely useless. It is said that the male dobsonfly use their jaws not only for display, but also to fight with other males and also to hold the female during mating. So maybe they have some important function somehow. We'll have to ask the females.