I’d like to describe this subject, according to memories I have, of how it was once described in material I read as a child.
In Physics and Chemistry, there often exist semi-permeable barriers, which are more commonly called semipermeable membranes. To call them membranes ignores the fact that pressure often exists across them, for which reason they need to be made thick. And thus, ‘barriers’ seems more appropriate to me.
Semipermeables can be such, that only certain ions are transported. For example, a barrier can exist that only allows sodium ions to pass, which are positive charge-carriers. What this means is that if we were to attach a pipe to each side of this barrier, which carries vaporous sodium in both cases, but with a difference in pressure, then the sodium will want to pass through the barrier. But the result will be that the pipe with the higher pressure, will also have a strong negative electrical potential. And the reason is the fact, that the only way in which sodium ions can pass through, is if electrons pass around the barrier.
By allowing electrons to flow, we allow sodium to flow from a higher-pressure source to a lower-pressure sink, where the ions recombine with the electrons.
I used the possibility of vaporous sodium to define the concept. But this is not strictly necessary. A solution of some kind, that bears sodium ions, should also work, as soon as their concentration is different on both sides of the barrier.
What I dimly seem to recall, was that ‘alpha-alumina’ would act as a selective carrier for sodium ions, at the temperatures of vaporous sodium. It would not allow free electrons to pass.