Military law is not something that applies to most of us. It is a very different system that operates along with our ordinary law.
Until the end of the Second World War, Canada simply used British military law. After the war, a review was conducted and resulted in the passage of the National Defense Act. This Act entrenches the Department of National Defense and the Canadian Forces (air, sea and land forces).
The Act also sets out a Code of Service Discipline that applies to military personnel. This code sets up a whole system of service offences. They are basically like criminal offences for the military.
Why a separate system of offences one for the military and one for all other Canadians? Mostly because the military wanted a quicker and more efficient system for punishing offences than the regular criminal system. Also, many service offences have a more severe punishment than regular criminal offences. Given the requirement for strict discipline in the military, offences are not viewed with much compassion.
A separate system is also practical because many offences for example, desertion are unique to the military. Many other offences such as theft or damage to property are similar to regular criminal offences.
What happens to soldiers charged with a service offence? For many offences, they can be judged in an informal manner by their commanding officers. Commanding officers can also try many more serious offences, but with these the solider has the right to be tried by a Court Martial. Technically, this term refers to a military court, not a punishment. Possible punishments range from minor things such as confinement to barracks or extra work detail to the reduction in rank, fines, imprisonment and even death.
One interesting aspect is the inter-relationship between the military law and regular criminal law. The regular law continues to apply to members of the military. But they will not be tried in two places for the same offence. This is called double jeopardy in law. Which law ought to be used depends simply on the connection the offence has with the military. Is it a military matter? Or has the soldier done something on leave, for instance that would better be tried in a regular court?