If there’s one thing Toronto mayoral candidate Jennifer Keesmaat has demonstrated throughout the current campaign, it’s that she knows her stuff: She knows transit. She knows city building. She knows housing.

According to one poll, she started the campaign 35 points behind the current mayor, John Tory — and with a week and a half to go, she’s narrowed the gap only a tad. Forum Research still has her down 27 points, meaning it would take a collapse of catastrophic proportions for Tory not to win.

And because Keesmaat, the city’s former chief planner, is smart, she surely knows that her campaign for mayor is unlikely to end in victory. As she’s pointed out, though, Calgary mayor Naheed Nenshi was in third place in the polls a week before election day in 2010 but was first when it mattered. So she’s not throwing in the towel just yet.

But every now and then in politics, even when you lose, you win. Keesmaat has never run for any political office before this one, but she’s been a quick study and demonstrated a considerable aptitude for politics. Of course, when she was chief planner, she was immersed in politics 24-7 — but despite her higher-than-normal profile, she still was a bureaucrat. She had the security of knowing that, for all the attention her tweets got (and she was a prolific tweeter), and for all her public spats with the mayor, she was the adviser, not the decider. She never had a vote on council, never had to submit herself to the voters on election day.

Stay up to date! Get Current Affairs & Documentaries email updates in your inbox every morning.

But over the past couple of months, Keesmaat has learned that she actually likes retail politics and is an even better communicator now than she was before — and she was pretty darned good before.

So if on October 22 she finds herself out of a job, I’d be prepared to make a decent-size wager that someone with the Ontario Liberals will come knocking on her door, trying to convince her to parlay a good campaign showing and increased profile into contesting that party’s vacant leadership.

If that knock on the door does come, here’s why Keesmaat might want to invite that Liberal envoy in for a coffee.

Typically, after a party loses an election (and especially if they lose in a blowout, as the Liberals did in June), party members end up looking for something completely different in a leader. The first and most obvious person to consider is the one who came second in the last leadership contest. In the Liberals’ case, that’s former Windsor-area MPP Sandra Pupatello. But she’s shown little interest (so far) in jumping back into the arena and taking on what could be a 10-year project to turn the party into a contender again.

So the next question is: Who represents generational change? Former Liberal leader and ex-premier Kathleen Wynne is 65 years old. Keesmaat hasn’t yet reached 50.

Furthermore, whether it’s fair or not, MPPs who were part of Wynne’s defeated government will have some of the tarnish of the Liberals’ 15 years in power to contend with if they seek the leadership — especially if they happened to be cabinet ministers. That means a higher mountain to climb for other potential candidates, such as Mitzie Hunter and Michael Coteau (who are still MPPs), as well as Yasir Naqvi and Charles Sousa (who didn’t survive the election).

Keesmaat has the advantage of being able to say: I had nothing to do with those 15 years. In fact, while the Liberals were selling off part of Hydro One and running massive deficits, I was helping to design a subway for Scarborough and moving billions of dollars’ worth of building permits through city hall. I’m a fresh face in politics. And, having been battle-tested by Tory in mayoral race, I might look pretty good on a debate stage with Doug Ford and Andrea Horwath (or whoever’s leading the NDP) in 2022.

If this sounds familiar, that’s because it’s happened before.

In 2003, Tory jumped into the race for mayor of Toronto. Today, he delights in reminding people that he was polling at a whopping 3 per cent at the outset. On election day, he managed to win 38 per cent of the vote — only five points behind the winner, David Miller. Even in defeat, Tory impressed people so much that, 10 months later, he became leader of Ontario’s Progressive Conservatives. Had he not made an ill-advised promise to extend public funding to faith-based schools (a non-starter for too many Ontarians), he and his fellow Tories might well have won the 2007 election and made Dalton McGuinty a one-term premier.

And, lest we forget, Premier Doug Ford took a chapter from the same playbook as Tory. Ford significantly boosted his brand four years ago, when he picked up the torch from Rob Ford, playing out the final weeks of his terminally ill brother’s campaign and managing to capture 34 per cent of the vote, just six points behind Tory.

I don’t know whether Keesmaat will run for the Liberal leadership — or, if she does, whether can win it. But in politics, it’s all about having a line of sight to the finish line, regardless of what the ultimate goal is.

For Keesmaat, the line of sight to the mayor’s office is extremely hazy right now. But on October 23, there’ll be a different line of sight.

Let’s see if Keesmaat answers that knock on the door then.