The better moisture sensors used in appliances use conductivity to determine when clothing is dry. Wet clothing is more conductive of electricity and the sensors measure the level of electrical current present.
A relatively recent addition to most dryers is the moisture sensor, which the appliance uses to determine when to end a cycle. There are a few different types of sensors used in dryers, but the best and most accurate is a conductive sensor. This sensor is usually visible just inside the drum as two, thin metal bars placed next to one another.
During a drying cycle, the dryer measures the amount of electrical current passing along these metal bars. Only a very small amount of electricity is used for the sensor. Since water is highly conductive of electricity, there is a much stronger current between the two sensors when the drum is full of wet clothing. As the clothing dries, the current becomes less and at a certain level it triggers the dryer cycle to end. The dryer is probably designed to turn off when different currents are reached, depending on the type of cycle and clothing dryness setting that are selected.
Other sensors may just be thermometers that check the air temperature inside the drum or that use two thin arms that physically stick together when exposed to humidity and wet clothing. When the arms no longer stick together, that triggers the cycle to end.