Darkness at Noon is a classic statement, in the form of fiction, of Lord Acton's principle that power corrupts, and absolute power corrupts absolutely. Koestler depicts the situation as it was in the Soviet Union in the late 1930s, though he never names the country and its leader is referred to simply as "Number One."
Rubashov is one of the "Old Bolsheviks," a leader of the Communist Revolution who has now run afoul of the regime and been thrown in prison. This is what happened in the Stalinist "purge trials," when Stalin turned on many of his comrades, forcing them to sign confessions that they had betrayed the revolution. In his ruthless authoritarianism, Stalin had become paranoid, trusting no one and wishing to preserve and enhance his personal power by eliminating anyone he perceived as a threat or a rival. The Bolshevik regime, whatever the original intentions of the 1917 Revolution had been, became a murderous dictatorship. It was also a genocidal regime under Stalin (though Koestler does not allude directly to this) in having created an artificial famine that killed millions of the rural population, especially in Ukraine, during the late 1920s and early 1930s.
The stated intention of the Revolution was to create a worker's state, in which the old ruling class would be disempowered and all people would be equal. In reality, as Darkness at Noon shows, the Soviet system ended up simply replacing the old Czarist absolutist regime with a similar (and even worse) dictatorship under Stalin. It was no different from the Fascist regimes in Germany and Italy, which the Communists claimed to be opposing.
The crucial thing about Rubashov is that although he has seemingly preserved in his own mind the liberal-socialist intentions of the Revolution, he realizes in reviewing his past that he has acted ruthlessly in carrying out the directions of the Party. His own actions, in turning against Party operatives in order to serve the wider cause of the regime, have been a betrayal of his own principles. Koestler's message is that a revolutionary movement inevitably deteriorates into such a betrayal, because of the very ruthlessness required to preserve the absolutist goals of that movement.