It's a big topic, and one you might want to spend some time on.
Senior leadership positions basically fall into two categories. There are the heads of crown corporations and specialized agencies, officers of Parliament, and so on. They tend to have fixed terms, employment contracts, and the severance clauses and all the disciplines that go with that.
Deputy ministers, in the sense of ministers who run departments and are close to ministers, have no job security. They do not have formal employment contracts, and they'd have no entitlement to severance. They operate with totally precarious employment.
Below the level of deputy ministers, if you're covered by the Public Service Employment Act, then you have very strong job security. You can only be terminated for cause, which is a legal test. It is extremely difficult to fire people in the public service for poor conduct or poor performance.