This was quite an exciting thing to see on the side of my shed – an Ichneumon wasp, recognisable by the frankly enormous spike on its rear end, longer than its own body in this case! Actually there are many species of Ichneumon wasp, not all so well endowed, but we can tell this is a female because that spike is actually an ovipositor used for laying eggs.
Some species – probably including this one, given its long ovipositor and like for crawling on my shed – use that long spike to drill into wood and lay an egg in a beetle within the wood. The larva then eats the beetle as it grows. They sense the position of the beetle with those long antennae and manage to pinpoint it from outside. It's hard to imagine that a delicate creature like this can bore through solid wood with that very fine needle, but apparently there is a concentration of metal at the end that makes it very hard. All in all a fascinating insect!