Every cell has its own potential called cell potential. If a potential greater than cell potential is applied from external source, non-spontaneous electrolysis occurs.
The reason it is non-spontaneous is because electrolytic cells are just two compounds that without an electrical current don't want to react.(Delta G +ve)