As the highest ranking officer of the fleet, only the Emperor himself was more important to the Empire than Tarkin. Since few interacted with Palpatine and Tarkin handled day-to-day military and political operations, it might be argued that he was in fact most important.
And through it all, Tarkin considered himself an enemy of the Empire.
Let's not exaggerate this. He was not a part of the Rebellion. He simply hated the Empire. He resented it, is perhaps a wiser statement. Maybe he just hated everything. No one ever saw him smile. He stole the idea of the Death Star, but in the end it certainly looked like his idea. His passion for what quickly became known as the "ultimate weapon" was legendary. As chief representative of the system of regional governors that replaced the Senate of the Republic, he already held great influence on countless worlds. Tarkin apparently decided he easily could eliminate any of them. Any of them. Even the ones best established in galactic civilization, like Alderaan, which he famously destroyed as an example of the Death Star's power.
Such an apparently arbitrary, flippant, casually-determined moment might have seemed like a show of strength for the Empire, but Tarkin meant for it to look like an act of terrorism, the full extent of what many already considered an Empire dangerously out of control. He alone had to ability to control Darth Vader, whom his command staff treated like the relic he represented, of the old ways, the Old Republic, the Jedi Order. Tarkin was one of the few who knew that Vader followed the Sith ways. Such distinctions meant little to others. To Tarkin, it meant everything. Any talk of Palpatine's own allegiances had been hushed up long ago. Tarkin's was a life that had been affected by the Sith more directly than anyone else. His was a world that had been devastated by the Sith, years before Palpatine rose to power, a testing ground. Tarkin's loyalty was a matter of survival.
But he wouldn't compromise forever. He grew increasingly reckless. He himself remained unimpeachable. No, he had to make it a matter of the Empire's reputation. With Vader by his side, the menacing loner whose reputation was entirely consumed by his strange powers and unwillingness to play nicely with the rank and file, Tarkin's plan would work regardless of what happened to Tarkin himself. He didn't care who defeated the Empire, so long as the Empire came to an end, the Emperor came to an end. Everyone knew the Emperor had no successor. Few knew as Tarkin did that expecting Palpatine to simply die was foolish thinking. Vader wasn't the answer. But Vader's son?
In his final months, when the plans for the Death Star were stolen by the Rebellion, Tarkin saw to it that the Jedi nonsense would finally resolve itself. The plans found their way to Tatooine, which otherwise meant nothing to galactic affairs. It was here where Vader's son could be found, could be drawn into Tarkin's plot, knowingly or otherwise. Trained to become a Jedi, perhaps. It didn't matter. He would join the Rebellion regardless, become a rallying point. Tarkin could use the Rebellion, naturally.
The Death Star was a target above everything else, a rallying point. Tarkin had seen that from the start. Destroy the Death Star and the Empire finally had a weakness. If it had never been constructed...? But of course Tarkin made sure it was.
He had grown weary. He couldn't endure the nonsense any longer. It was, among other things, an engineered suicide. Everyone around him thought it couldn't be done, certainly not by the pathetic Rebel fleet. He made sure to foster this belief. But he knew better than anyone that it could be done. That was why he had allowed the plans to be intercepted in the first place.
In his final moments, Tarkin smiled for the first time in his life. Doubtlessly, no one knew what they saw when it happened. It didn't matter. The outcome was now inevitable. He had won. He had been avenged. Whatever followed would be better...