Definition
Electrolysis is when electricity occurs in liquid
Electricity in liquid can only occurs in molten ionic compound and aqueous solution
Liquid conducts electricity and chemical changes occurs while liquid metal wont make any chemical changes as they rely on the sea of "delocalized electrons"
Electrolysis And Movement Of Ions
Electrolysis occurs when there are 2 graphite places on a liquid

As you can see, there is beaker with water in it, with that stays cathode and anode which are 2 graphite's and a electrolyte solution
Ions move freely and conduct electricity
There are anions and cations in the solution
The anions go to anode as they are negatively charged particles
The cations go to the cathode as they are positively charged
Anions move to anode and cations move to cathode as anode is positively charged and cathode is negatively charged making the opposite attract
When anions and cations move through the cathode and anode they form electricity
Electrolyte And Non-Electrolyte
Electrolyte is a ionic compound that conducts electricity
Non-electrolyte is a ionic compound that doesn't conduct electricity