The typical installation is in the exhaust manifold, where the hot exhaust gases will pass by it. My car has a heated sensor, so the sensor starts to work very quickly after the engine has started. It has three wires. Two are for the heater, and one is the sensor output. The metal case of the sensor is grounded and is the return for the sensor's output.
Unheated sensors have one or two wires.
I do not know the exact composition of the sensor, but I do know how it is constructed and how it operates. A ceramic-like material is exposed to the exhaust gas on one side, and to the outside air on the other. A voltage is produced as oxygen travels through the material. A rich mixture will produce almost 900 millivolts. A lean mixture produces about 100 millivolts or less.