A carp has teeth at the back of it’s throat. They feed by sucking up their food, rolling it around their mouth deciding if it is something to eat or just a stone piece of wood etc. If the object is something to eat they pass it to the back of their mouth where they will crush it and swallow it. The hair rig allows the bait to be sucked up, evaluated, and passed to the throat with the hook either outside the mouth or inside but free of the bait. Carp frequently pick up bits of metal so the hook itself is not deemed a threat, but the carp cannot eject it as it normally would because it is part of the food it is trying to chew. The length of the hair is very critical. Rigged right you almost always end up with lip hooked fish that can easily be released, rigged too long or short and you just get frustrated with line bites and taps.
Hair rigging can be done with paste but instead of a loop the English tie a small spring like device to the hair and mold the paste around it. Hairs can be used with nuts if you drill a hole through the nut, hard seed corn, sweet corn, chick peas, boilies, meat (like Spam) and other solid or semi solid baits. You can also weight the line a few inches behind the hook and add a piece of foam or cork to the bait on the hair and the hook and bait will float just off the bottom (called fishing a pop-up) it is a deadly method.
I rigged a dead frog with it’s mouth stuffed full of foam and stitched shut on a hair rig popped up about six inches off the bottom and set just outside a weed bed and took a PB eel, so hair rigs work for more than Carp too.
Those Carp lips are delicate too and if the fish feels the line passing over them it often rejects what ever is in it’s mouth. There are ways to make this work for you. A stiff rig is tied with stiff mono in such a way that the carp will aggressively try to eject the bait and hook itself, or you can tie your bait and hair with soft braid and again they will self hook but when they feel the weight. A soft rig is very difficult to eject, but very prone to tangling on the cast without doing some fancy rigging and having a very smooth cast. I usually use stiff rigs at distance and braid rigs for close in work, but not always. The bottom type, the depth, the flow all determine what rig is best.

These are paste springs for hair rigging paste baits.
Another obscure bait that Carp seem to delight in are Gummy Bears. They leach sweet flavors and some color into the water so you need to refresh them every half hour or so. They are soft so the Carp suck them up with reckless abandon.