This is called a powerhead. It fastens to the tip of the spearshaft on a speargun. It chambers a single .38 special round that has been sealed with nail polish at the rim and primer. It's used to shoot sharks that get a little too frisky. It’s actually made of two pieces that screw together. The front piece chambers the round, and the back piece contains a firing pin. The hair-pin you see is the safety. Once you pull the pin out there is some play between the two pieces and the force of impact slams the firing pin into the primer. The expansion of gas actually does more damage than the slug.
A speared fish is pretty much a dinner bell to sharks. Sharks show up almost every time we spearfish, but they rarely get too close for comfort. My dive buddy shot an overly aggressive bull shark with one chambered in .223 cal and it blew a soft ball sized chunk out of it, stopping it cold. A gunshot that you aren't expecting underwater will startle the beejeezus out of you!