From memory -- and I can look some things up if you need hard data:
Capacitive sensor work with a finger arrangement, and a dielectric between these: the dielectric absorbs moisture form the air, and sin Water has a high epsilon_r, this changes the capacitance greatly. ISTR these measure rH, so the amount of water in the dielectric varies with the relative humidity. (Though pretty much any and every sensor is temperature-dependent). Capacitive sensors are often used to determine the frequency of an oscillator, and this can then easily be measured by a processor.
The variation will be nonlinear. In a more expensive measuring unit, I found a calibration function for two set points, ISTR 13 % rh and 76 % rh, corresponding to saturated salt solutions of lithium chloride and sodium chloride. Both at somewhere around 20 °C. In a cheaper one, the function will be a one-size-fits-all calculated from the mfg data sheet using typical values.
Resistive sensors may be linearized using a parallel and series resistor, to give a nearly-flat response of part of the range.
There's also an industrial sensor, accurate and measures absolute humidity. Downside is it needs a lot of power (relatively) and it must be continuously on: Lithium chloride cells. A sock of lithium chloride solution is heated, and then the steady-state temperature is measured. The LiCl absorbs water, it is hygroscopic und ~13% rh, and the heat drives the water off. The temperature is a measure of the dew point. A problem is that if left in humid air, and not heated, the LiCl can drip off. You may be able to get one used, cheaply?
Then there's the variations on "hair in air": various materials that change their length with (usually) relative humidity. Some of the cheaper "humidistats" work like that: a material expands and contracts, and operates a click-bendy spring to open and close a contact, knob to adjust the switch point. Lots of hysteresis included for free -- good thing if running a compressor dehumidifier.
Thomas Prufer