It helps keep materials out of the cell that shouldn't be there and if there is a balance of say salt ions it will open protein channels to allow salt through to make it balanced. It does this for other molecules such as water, sugars, enzymes etcetera.