Electrolysis takes place when two electrodes are immersed in an electrolyte as the constituents of the electrolyte are split into oppositely charged ions when a current is passed through it. Each of the ions is then attracted to the electrode which has an opposite charge.
As an example, let the electrolyte be AB which is formed by A+ and B- ions. When current is passed through AB it splits into A+ and B- ions. The A+ ions are attracted to the negative electrode, where they accept an electron and are converted to A. Similarly the B- ions are attracted to the positive electrode and give up their electron to the electrode, which converts them to B.
If the two electrodes are short circuited, there is no flow of electricity through the electrolyte. Also, the electrodes will not be able to attract any oppositely charged particles. This results in no electrolysis taking place.