This is probably a silly question regarding ion selective measurements, at least the pH one, but couldn't come with a clear answer.
I know how a electric potential is made between the sample and the indicator electrode which is immersed in its own reference solution. Also, it's clear to me that a second reference electrode is required to be on the sample side to measure the whole potential across the selective membrane.
What isn't clear to me is why the reference solution needs to be separated from the sample, immersed in its own solution and connected to the sample via the liquid junction. Why can't the metallic electrode and wire just be immersed on the sample itself to measure the potential across both sides of the membrane? Is there a theoretical reason to do it or is it merely a practical one (fouling or corrosion of the metallic electrode in wire by the sample)? The way I see it now, adding another inner solution and the liquid junction just introduces more places for error and if the electrode and wire are made of a noble metal (silver, gold, platinum), there shouldn't be an issue with sample interaction.