The threat of controversy and unrest looms over Kenya's elections, which will be held on 8 August. Incumbent President Uhuru Kenyatta is ahead by a whisker in the most recent opinion poll. His main challenger, Raila Odinga, has repeatedly alleged that Kenyatta plans to rig the elections.
Kenya has an unhappy history of violence, and of alleged election rigging, and the recent gruesome murder of a key official at the electoral commission has heightened anxiety. Some fear that - whatever the electoral laws say - no holds are barred in Kenyan politics.
That history of electoral problems is interwoven with a dynastic political drama that goes back more than 50 years. Jomo Kenyatta and Oginga Odinga were political allies turned enemies in the 1960s; now their sons continue the rivalry.
Kenya's most powerful politicians are a small group, many of whom know one another socially, and many of whom have served in government together over the years. Raila Odinga's running mate was in office for years under the old ruling party. So too was Musalia Mudavadi, one of Odinga's close allies in the opposition coalition, whose father was also a senior politician.
Kenya's politics can sometimes look like long-running squabbles amongst a gang of cronies, and newspaper cartoonists like to portray the Kenyan voter - routinely personified as an oppressed but doughty woman, Wanjiku - as the victim of these scheming rivals.
All the more so because these dynasties are linked to ethnic rivalry. The muted background narrative of Kenyan politics is that access to the presidency has made some communities rich while others stay poor, and politicians stand accused of fostering that narrative, stirring up tribalism to win office and pitching ordinary Kenyans into violent confrontations.
Politicians are blamed, too, for the widespread use of gifts, and cash handouts, in elections - buying votes for a few shillings and a bottle of fizzy drink, and then going on to abuse their elected office to enrich themselves through corruption.
Kenya's elections then, appear as the ruthless game of leaders who pursue power at the expense of their people, not on their behalf. But talk to any candidate at a level below the presidency - for Kenya's elections involve six separate ballots, for multiple positions in national and county government - and a slightly different picture appears.
The moral economy of elections
Candidates constantly complain of the demands of voters.
Need to meet women voters in a particular village? It can be arranged, but often requires 'facilitation' to be provided - money to organise soft drinks, and hire chairs. And once you have spoken, you cannot leave your audience empty-handed. Each person must get at least a token gift, even if it is only fifty shillings (about half a dollar).
Need to reach a wider group of influential people? Easy - speak at the funeral of some well-known local elder. But if you are to do that, you must make a donation to the grieving family.
Or perhaps you are anxious about the youth vote? Here is a youth group, willing and ready to hear your message. But they might also expect that you will help them set up as motorcycle taxi riders.
And then there are the personal requests: the voter who cannot afford school fees for their children; the constituent who needs help with mounting hospital bills.
A commentator even recently suggested that the demand for "something small" was so high that the 2017 elections had made the 50-shilling note an "endangered species".
Faced with these multiple demands, candidates find little support from the party whose colours they wear. They spend their savings, or sell their assets. They borrow from family and friends. Some lose everything, impoverishing themselves and their families - and still lose the election.
Those who do win election take up office with multiple debts. The temptation to use office corruptly to repay those debts, and build up funds for the next campaign, is a strong one.
Yet many voters don't consider their demands wrong; after all, they say, those elected often enrich themselves and ignore their constituents. Voters' demands are a moral test.
The overall message of elections in Kenya is a simple one: government exists to bring development, and those elected are delegates, sent by their constituents to secure at least a fair portion of development - which may take any material form from youth training centres to tarred roads to a cabinet seat for a local. Voters need to be sure both that their representatives can deliver, and will respond to local demands. As a result, the campaign becomes a prolonged test of politicians' virtue - will they meet constituents' expectations?
Ethnicity plays into this. Bureaucratic accountability does not always work in Kenya: people don't necessarily follow the rules. So having someone on the inside - a cousin, an in-law, a friend of a friend - is always useful. So too with politics: voters want representatives on whom they feel have some moral claim. That need not be ethnic - but it may often coincide with ethnicity.
And, of course, voters want to feel that their representative, in turn, has similar claims on people further up in the hierarchy of power. Ordinary people do not need to be 'tribalists' to vote on ethnic lines; they just need to doubt the impartiality of the system.
Once they do, they will begin to think that development may be denied them unless 'their man' wins office.
Which is not to say that Kenya's politicians are not culpable, for their behaviour has encouraged ethnic politics, and lavish electoral spending. Nor is it to excuse the high-stakes games around the presidential election that currently threaten to generate political unrest.
But this moral economy of elections does help to explain why Kenyan voters turn out in large numbers to cast their ballots. Kenya's electoral politics are not just an elite game of thrones; they are driven by the demands and concerns of ordinary people, trying to navigate their way to the uncertain promised land of development.
Research for this article was has been funded by the UK Economic and Social Research Council (under grant ES/L002345/1) and the East African Research Fund.
Nic Cheeseman does not work for, consult, own shares in or receive funding from any company or organization that would benefit from this article, and has disclosed no relevant affiliations beyond the academic appointment above.