A glass electrode works based on the principle of electrochemical potential. The thin glass membrane selectively allows hydrogen ions (H+) to pass through, creating a potential difference between the internal solution and the external solution. This potential difference is measured and converted into a pH value. The glass electrode is typically connected to a pH meter, which displays the pH reading.