How does this Arduino liquid level sensor work?

Your concern is correct. This type of sensor actually measured "conductivity" of the liquid. So if you have a non conducting liquid it will not provide a satisfactory reading.