The bathroom slippers reduce the severance of the electric shock. It is also dependent on the current in play. If it's minute, the bathroom slippers act as an insulator from allowing the current flow through you to earth.
It is the same principle that insulation mat is used by technicians and engineers while working at high voltage installation
Insulation mats are made of rubber. ... Rubber is a natural dielectric material and will, therefore, inhibit the flow of electric charge as a result of its molecular structure preventing the free flow of electrons.
Also, your body's conductivity increases if you are wet. This is because water is a conductor of electricity. That is why if you are wet and barefoot and touch the refrigerator which has some leakage current in a house that is not earthed, you'd get some shock. But if you are dry and wearing thick rubber shoes (one of the reasons electric engineers/technicians wear safety shoes with thick rubber soles while working) you'd open the same refrigerator and feel no shock.