 Having a difference in concentration across the two then allows you to open little pores, little gates, which allow the salts to flood back across the membrane. And as they do so, you get a kind of pulse of voltage across.