Some of the electronic level switches use ultrasonic sound waves to detect the presence of process material (either solid or liquid) at one point:

Sound waves pass back and forth within the gap of the probe, sent, and received by piezoelectric transducers. The presence of any substance other than gas within that gap affects the received audio power, thus signaling to the electronic circuit within the bulkier portion of the device that the process level has reached the detection point. Due to the lack of moving parts the probe is quite reliable.