They had a couple of teams, one feeding information to the Democrats and one feeding information to the Republicans. Ditto for salting information on social media.
They did not care who won the election. But whatever side won, they then provided data on their activities to the other side. Trump won, the Democrats got the information they needed to start an investigation that lead to the Mueller Report. But if Clinton had won, the Republicans would have gotten a similar data dump that would have led them to investigate the Russian influence that had led to Clinton's victory.
The actual purpose was not to ensure anyone's victory. It was to sow further infighting between the parties, tie up the U.S. government and the President, and limit that President's effectiveness and legitimacy. It's a long con based on their understanding of how we run election campaigns and the desperation of political operatives to gain any advantage.
The battlefield is a scene of constant chaos. The winner will be the one who controls that chaos, both his own and the enemies.