William F Buckley ran for Mayor of New York with barely a chance of even getting noticed. When asked what he would do if he won, he said " I would demand a recount" [ yes, that is a joke]
You run to bring issues to the public notice and force some response in the candidates who have a chance of winning. Pro-life candidates often do just that.