Kenyans vote for a new president on Tuesday, ending a heated race that shows why, in a troubled region, the East African nation matters more than ever.KANGARI, Kenya — The helicopter swooped over the lush tea and coffee fields flanking Mount Kenya, Africa’s second highest peak, and touched down outside a small highland town where William Ruto, the self-proclaimed leader of Kenya’s “hustler nation,” stepped out.Mr. Ruto, a front-runner in next Tuesday’s presidential election, is pinning his hopes on what he calls Kenya’s “hustlers” — the masses of frustrated young people, most of them poor, who just want to get ahead. He delights supporters with his account of how he was once so poor that he sold chickens on the roadside, and with his spirited attacks on rivals he portrays as elitist and out of touch.“I grew up wearing secondhand clothes,” he boasted to a roaring crowd in Kangari, where farmers and traders crowded around his election vehicle, a canary yellow, blinged-out stretch S.U.V. “Every Hustle Matters,” read the slogan on its door.The odd thing is that Mr. Ruto has already been in power for the past nine years, as the vice-president of Kenya. And he has become a very wealthy man, with interests in land, luxury hotels and, perhaps fittingly, a major chicken processing plant.Contradictions abound in this Kenyan election, a blistering and unpredictable contest between Mr. Ruto, 55, and Raila Odinga, a veteran 77-year-old opposition politician who is making his fifth bid for the presidency, having failed in the first four. But the perennial outsider is now cast as the insider after striking an alliance with the man who for years was his bitter enemy — the outgoing president, Uhuru Kenyatta.Supporters at a Ruto rally in Machakos, last month.Yasuyoshi Chiba / Agence France-Presse — Getty ImagesDays from the vote, the race is a nail-biter — a sharp contrast with many other African countries, like Uganda and Mali, where once-high democratic hopes have given way to sham votes and military coups. To its Western allies, that underscores why Kenya matters more than ever. Since its first competitive multiparty elections 20 years ago, the East African nation has emerged as a burgeoning technology hub, a key counterterrorism partner, a source of world-class athletes and an anchor of stability in a region roiled by starvation and strife.Kenyans are enthusiastic voters, with an 80 percent turnout in the 2017 election (compared with 52 percent for the United States presidential race a year earlier); on Tuesday 22.1 million registered voters will choose candidates for six races, including president, parliament and local bodies.The vote comes at an anxious time for weary Kenyans. The pandemic and the war in Ukraine have pummeled their economy, which is straining under billions of dollars in debt for Chinese-built road and rail projects. In the north, a devastating four-year drought threatens 4 million people with starvation.But this race is less about issues than a titanic clash of personalities, of age against ambition — peppered with a steady stream of personalized attacks.Mr. Ruto, a charismatic and ambitious leader with a ruthless edge, mocks Mr. Odinga as “the Riddle man,” a dig at his tendency to quote folksy proverbs and riddles, and as a “project” of his ally, Mr. Kenyatta.Raila Odinga at a campaign rally in Kirigiti Stadium, in Kiambu, on Monday.Ed Ram/Getty ImagesMr. Odinga, a veteran leftist who estimates that corruption costs Kenya millions every day, has another word for his opponent. “The thief is?” he asked the crowd during a rally in Machakos, 40 miles from Nairobi, on a recent afternoon.“Ruto!” replied his supporters.Accusations that Mr. Ruto’s team is prone to graft (or, at least, more prone than its opponents) were bolstered by the courts last week when the High Court ordered his running mate, Rigathi Gachagua, to forfeit $1.7 million in illicitly acquired government funds. Mr. Gachagua, whose bank accounts were frozen by a government anti-corruption agency in 2020, is appealing the judgment, which he rejected as politically motivated.Mr. Odinga also faces accusations of unsavory compromise. The son of Kenya’s first vice-president, he spent most of his career on the opposition benches. He personalizes a sense of grievance among his fellow Luo, Kenya’s fourth largest ethnic group, who have never had a president.After weeks of neck-and-neck polling, the latest figures give Mr. Odinga a clear lead. He is boosted by the buzz around his running mate, Martha Karua, seen as a principled politician with a long record of activism who, if elected, would become Kenya’s first female vice-president.Supporters of Mr. Odinga’s party in Kisumu, on Thursday.Patrick Meinhardt/Agence France-Presse — Getty ImagesOne wild-card is a third candidate, George Wajackoyah, who has captured a small but boisterous protest vote on the back of his proposals to legalize marijuana and, more outlandishly, to export hyena testicles to China (where they are said to have medicinal value).If Mr. Wajackoyah can hold onto his slice of the vote, as much as 3 percent in the polls, he could deny Mr. Ruto or Mr. Raila the 50 percent majority needed to win, and trigger a second round of voting 30 days later.One of the biggest forces in the race is not on the ticket. The current president, Mr. Kenyatta, turned politics upside down in 2018 when he struck a political deal known as “the handshake” with Mr. Odinga.The alliance ended an enmity between Kenya’s two great political dynasties that stretched back to 1969, when Mr. Kenyatta’s father, then president, imprisoned Mr. Odinga’s father, an opposition leader, for 18 months.But for many Kenyans, the handshake was little more than “the children of kings” doing a deal to benefit themselves, said Njoki Wamai, assistant professor of international relations at the United States International University-Africa in Nairobi.President Uhuru Kenyatta, turned politics upside down in 2018 when he struck a political deal known as “the handshake” with Mr. Odinga.Thomas Mukoya/ReutersMr. Ruto, stung by a perceived betrayal, built up his own base in Mr. Kenyatta’s political backyard in Mount Kenya, the ethnic Kikuyu-dominated area that accounts for about one-quarter of the Kenyan electorate.The vitriol between the two men is never far from the surface. “You have enough money, security and cars,” Mr. Ruto told a rally recently, addressing the president. “Now go home.”“Don’t vote for thieves,” Mr. Kenyatta told his supporters days later. “Or you’ll regret it.”One obstacle facing both candidates is apathy. Younger Kenyans in particular say they are turned off by the byzantine feuds, alliances and back room deals that preoccupy their leaders.Evans Atika, a barber from Nairobi’s South C neighborhood, fits the profile of a typical “hustler.” But having voted in 2017, he intends to stay home this time. “They’re all the same,” he said. “They lie. They made promises they can’t keep.”Kenya’s elections are among the most elaborate and expensive in the world. This one is expected to cost $370 million, using ballots with more security features than the country’s currency notes. But elections here have a history of going awry.Employees of the Independent Electoral and Boundaries Commission arranging ballot boxes and election material at a tallying center in Nairobi, on Thursday.Baz Ratner/ReutersWidespread violence following a disputed result in 2007 led to over 1,200 deaths, displaced 600,000 people and triggered an International Criminal Court investigation into politicians accused of bankrolling death squads and fomenting ethnic hatred. Mr. Kenyatta and Mr. Ruto, were indicted with crimes against humanity.But by 2016, both cases had collapsed, following what one judge called “a troubling incidence of witness interference and intolerable political meddling.”Other Kenyan elections have resulted in courtroom disputes that ended with judges overturning the results. And days before the last poll, in 2017, a senior election commission official was found brutally murdered in a remote wood outside Nairobi.The case was never solved.This time, worries about widespread, election-related violence are lower, human rights monitors say. But in recent weeks, some residents in ethnically mixed areas, especially in the Rift Valley which saw the worst unrest in previous polls, have voluntarily moved to the safety of larger towns.Much will depend, though, on the final result. Kenya’s election commission has one week to declare a winner, although analysts expect that the losing side will lodge a legal challenge, prolonging the contest.One bright spot, amid the mudslinging, is the potential for a sea change in the corrosive ethnic politics that have dominated Kenya for decades. The shifting alliances mean that, for the first time, millions of voters are expected to cross ethnic lines, especially around Mount Kenya where, for the first time, Kikuyus will have to vote for a candidate from another group.“I love that man,” Michael Muigai, a self-identified “hustler,” said after the rally for Mr. Ruto in Kangari.Mr. Muigai, who is 22, is working construction on a Chinese road building project to make his fees for a deferred college placement. He said he didn’t care that Mr. Ruto is an ethnic Kalenjin, and shrugged off media reports linking him to corruption.“Past is past,” he said.Election posters in Nairobi.Baz Ratner/ReutersDeclan Walsh More