They're basically analog computers that take several inputs — engine speed, throttle setting and so on. Through an arrangement of valves they compute the appropriate gear setting and generate hydraulic output signals that control actuator valves which will engage and disengage several clutches to select the correct gear.