The only ways to leave Canada are by air or to the US, and in either case your departure will be shared with the Canadian government by either the airline or the US government. Among other things, it prevents residency fraud (claiming benefits like healthcare or old age pension while actually living abroad).
Countries that lack strong bilateral cooperation with their only land neighbour have to use other methods, like exit controls.