Potential measured by pH meter is a sum of all potentials present in the system. Putting aside junction potentials that can be present in the experimental setup, we are left with three sources of electromotive force. First builds up on the glass electrode, thanks to different activities of the H+ ions on both sides of the glass. Second source is the glass electrode silver wire covered with AgCl and immersed in the solution of chlorides, and third is the reference electrode - silver chloride or calomel, depending on the application.
Thus the real potential measured is sum of three potentials:
where (see Nernst equation section)
which finally leads us to the (almost - read on) final equation describing measured potential:
Where E0'' contains all constants mentioned above and in the Nernst equation section. As you see after taking (almost - read on) all factors into account we can expect perfect linear dependence between measured potential and pH.
One may ask at this point, why do we complicate things adding two additional sources of potential (EAg/AgCl and Eref), instead of measuring just the potential of glass electrode which behaves as the concentration cell? The answer is simple - there is no easy and practical way of measuring the glass electrode potential. We may think of two added reference cells just as of reliable contacts, interfacing metal wires and solution. While they add their own potentials shifting glass electrode potential readouts, it doesn't matter. First of all, we never need absolute values of glass electrode potential, as only difference being proportional to the difference in pH of both sides of the glass counts. Second, even if we will be able to measure absolute potential it will not help us much, as it depends on many additional things - like internal tensions in the glass, or the smoothness of the glass surface. As we already have to compensate for these impredictable factors, additional, constant shift in voltage doesn't change our situation.
Junction potential, that we have ignored in the above equation, in practice can be an important source of error. It was an important issue back in the early eighties of the 20th century. Most modern electrodes are less prone to this effect.
Every electrode has a characteristic pH where its potential is 0 (so called isopotential point). Carefully choosing potentials of both reference electrodes (which can be done with selection of chlorides concentration) it is possible to compensate for all other sources of potential in the electrode so that isopotential point is at pH=7.0. Most modern pH electrodes are made this way.
As it was mentioned above so far we have looked at almost all factors, but some are still left uncommented. Glass electrode potential depends on the presence of other then H+ ions in the solution. While carefull selection of the glass used makes this difference small, it can't be neglected. More on that in electrode selectivity section.