A working hypothesis, subject to being disproven and probably incorrect in several respects:
The Putin Government has a list of issues that they perceive as points of conflict with the US and NATO countries. At the top are Syria and Ukraine, but the list extends beyond that.
In 2016, they viewed Hillary Clinton as the most likely next president, but not as a sure bet. They saw her as competent and hostile to their interests. They created a barrage of fake news and stole and leaked true information to lower her odds of winning and to weaken her mandate if she prevailed.
They viewed Donald Trump as having some chance of winning, and they much preferred that outcome. He had ideological affinities with Putinism (as a form of macho authoritarian White Christian nationalism) and was likely to divide and weaken US political institutions and alliances while also bringing disrepute to the US. So they directed their propaganda to favor him and chose not to leak secret information about him, if they had any.
Meanwhile, Trump’s entourage included a bunch of characters who had strong ideological commitments to Putinism or financial ties to Russia, or both. By enticing these men into back-channel conversations or business deals, the Russians could gain leverage over them. This might influence US foreign policy. Alternatively, the Russians could suborn scandalous or unlawful behavior and use (or threaten to use) their knowledge of these secret interactions at their convenience.
Trump had no idea of any of this. He thought the stolen information from the Democratic Party should be public and he believed the fake news that he retweeted. He either didn’t know about the back-channel conversations or didn’t think they were inappropriate. To this day, he doesn’t understand what was wrong and he regards the criticism he’s receiving from the security agencies, Congress, and the press as sheer partisan hostility. This is why he continually draws attention to the scandal instead of trying to distance himself from it.
Trump did, however, state publicly and privately tell James Comey that he wanted the investigation to end. By firing Comey when he didn’t comply, Trump probably obstructed justice. That would be a felony carrying up to five years in federal prison. Although some people in Trump’s orbit may have committed original crimes (such as receiving Russian money unlawfully), the main violations involve interference with the investigation.
Meanwhile, Putin has gotten what he wants as the Trump government squanders American soft power and weakens the Western Alliance. Neither is exactly an intentional goal of the Trump administration, whose malice is exceeded by its sheer incompetence.