To apply for a 186 visa, you must be nominated by an Australian employer. However, there is no enforceable requirement that stops you leaving your employer after your visa is granted. The Department of Home Affair has no control over the circumstance that you and/or your employer changes intentions, resulting in the employment contract being terminated. Importantly, there is no condition of ENS visas saying that employees must remain working for employers until the end of contract.
Nevertheless, you should be aware that you are required to submit the employment agreement to the Department of Home Affair when lodging your visa application. This contract must clearly state that the job position is offered to you for at least two years. The purpose of the contract is to demonstrate that you have the intention to stay with your nominating employer for a long period, and your position is genuine in the business. Therefore, the Department will retain its discretion to investigate your changing situation. If you provide misleading and incorrect information, or if you have not made a genuine effort to work for your employer, then the Department has a right to cancel or revoke your visa.