There are a couple of different types. An old-style purely mechanical gauge has a pressure bulb that gets screwed into a coolant passage in the engine block (you can often "tee" a fitting in so that it shares the same coolant port as the car's own idiot light sensor. A capillary tube runs to the gauge mounted on or under the dash. These are usually very accurate, even for the cheap models under $25. The drawback is that you have to be very careful in routing the capillary tube because if it becomes kinked or broken, the gauge is useless. You also have to have a large enough hole in the firewall to feed the pressure bulb and capillary through.
Electric gauges have an electric sensor that goes in the coolant, just like the capillary bulb. But you can install it, and then route the power and sense wires however you need to. They're more expensive, and the lower end ones are not always very accurate.