The Asian horntail laying eggs in a dying tree.  This is a species native to Japan that was accidently imported into the US.  The 1-2 inch ovipositor (black tube center of the insect near the top of the adbomen) is pushed into the tree and the abdomen is moved back and forth, left to right and up and down, to force it deep into the tree where eggs are laid.  Oviposition usually occurs in a dead or dying tree.  The larvae bore in the wood where they will eventually pupate.