Warning: spoilers for season five below!
The only thing that's safe to assume about characters on House of Cards is that no character is safe, regardless of how important they seem. Season five is no exception to this rule. While it could be said that the fate of LeAnn Harvey isn't exactly unexpected, the death of Tom Yates is more of a surprise because he isn't mysteriously taken out by unknown assassins — he's killed by Claire.
The affair between Tom and Claire starts out simple enough but becomes something more complicated by season five, especially for Tom. Tom gives Claire the physical attention that never seems to be a part of her relationship with Frank, and she enjoys feeling wanted in this way. The season's eighth episode is when their dynamic starts to change. Tom tells Claire he loves her, and she admits that she might love him too. Tom attempts to separate their romantic relationship from their professional one and tells Claire he doesn't want to write her speeches anymore. She appears fine with the idea, but Tom stays in the White House so they can continue their affair.
Two episodes later, Claire confesses to Tom that Frank killed Zoe Barnes and that he should be scared of her (which Tom brushes off). This comes just before information is leaked to the press about some of the shady business the White House had been up to on Election Day, and Frank advises Claire to be extracareful about what she says. Claire realises she's probably already gone too far with Tom and coldly tells him there's no longer any place for him with her anymore.
Tom leaves but is clearly hurt. In the season's penultimate episode, Claire finds out that Tom continued writing his book about Frank and Claire, which was the original reason he spent so much time around them. The book alludes to incriminating details about Frank and Claire (including some information that Claire had shared with Tom in private) and would be a huge blow to the Underwood administration if published.
Claire goes to visit Tom at Mark Usher's house to tell him not to publish the book and finds out that the only copy of the manuscript is in her possession. She seduces him one last time and fatally poisons him with an overdose of Gelsemium, the migraine medicine Jane Davis gave her at the beginning of the episode. For a moment Claire looks shaken, but she quickly collects herself and leaves, retrieving the medicine before she goes.
There's no denying Claire cared for Tom, and if Tom hadn't threatened to become a liability, she probably wouldn't have been driven to remove him from the picture. But Tom saw their relationship as something more important than politics, and when it comes to Claire Underwood, political ambition beats emotion every time.