The Criminal Code provides discretion to the courts to impose consecutive sentences generally and then in some instances directs the court to impose consecutive sentences for certain types of offences.
Examples include some terrorism offences. If a child sexual offence—a contact offence—is committed and the individual is being convicted at the same time as for a charge dealing with child pornography, that would draw a mandatory consecutive sentence.
Otherwise, the Criminal Code codifies what was the common law practice, to tell the court that it has the discretion to oppose consecutive sentences when it's appropriate rising out of separate chains of events.