To put it mildly, these two didn't along. They both controlled factions that between them were tearing apart the General Assembly, which was the world's first democratic parliament.
Now in Athens they didn't need elections to their parliament, because every citizen was his own representative.
But they did have elections to exile people from the city. This was called an ostracism. The way it worked was that once a year anyone could propose that there be an ostracism. If the Assembly voted in favour, then it was certain that someone was going to get tossed out, but no one knew yet who that someone was. They had to have a vote.
This was a vote you wanted to lose, since the "winner" was exiled for ten years.
On election day every citizen would write the name of the person they wanted to see gone. Whoever got the most votes was the loser. The voting slips were broken pieces of pottery, of which Athens had plenty since almost every type of food in every kitchen was stored in ceramic jars. The ancient Greek word for pottery shard is ostrakon. The vote was named after the voting slip: ostrakismos. Hence our English word ostracism is named for broken bits of pottery.
So Nicias and Alcibiades were causing lots of trouble, and everyone would be quite happy to see one or the other ostracised.
A dodgy minor politician named Hyperbolos, who wanted more power, realized he could make use of this. He proposed an ostracism. The followers of both Nicias and Alcibiades thought this was a wonderful idea, imagining the other side's leader being told to pack his bags. The vote passed easily.
It was at this point that Nicias and Alcibiades both became very, very uneasy. Neither was certain he'd survive the vote.
The two got together for a quiet chat, and probably through gritted teeth for the first time in their lives managed to agree on something.
They both told their followers to vote for Hyperbolos.
When the count was complete, Hyperbolos was the one who ended up being ostracized. Which probably isn't what he had in mind when he proposed the vote.
The result was such a shocker that the Athenians never again held an ostracism.
The voting slips when they were done with were used as landfill, since ceramic is kind of hard to get rid of any other way. Thousands of these ostraka have been dug up around Athens. The one in the picture has the name Hyperbolas written around the edge. This is one of the votes that did him in.