Despite a bumpy first term, Justin Trudeau’s Liberal Party has earned a second, narrow election win.