Actually, there are many species of praying mantises and in most of them sexual cannibalism is quite rare. It occurs much more often in the laboratory than out in the field. Apparently, the lights and sounds of a laboratory are stressful to the female so she acts aggressively in response.
The praying mantises are very aggressive predators and they can eat quite a lot of food, preferring soft-bodied insects (like flies), but not turning their heads away from cockroaches, snakes….
…. or other mantises, including males of their own species:
The male may be eaten before, during or after the copulation. Male is a great source of protein, so eating him afterwards makes sense for the female:
In only one species, the Mantis religiosa, does it appear that decapitation of the male actually may be neccessary for successful copulation. The removal of the male’s head triggers reflexive copulatory motions, resulting in faster ejaculation – why that increases females’s fitness is not clear.
A female may eat a male before copulation, especially if she is hungry, the male is small and it is early in the breeding season – he is worth more as food than as sperm donor at that stage.
Videos from out in the nature, though, more often than not, show elaborate mating behaviors and successful escape by the male afterwards. Sometimes they may even engage in a threesome:
While in some other animals there is an advantage for the male to be eaten after mating, such an advantage was not shown in praying mantises. A recent study shows that male mantids prefer not to be victims of sexual assault after all. But sometimes, when she is hungry and you are a lousy lover, that is what you get….