With my small sample size, and having not looked at the files, it seems as if the best way to win is to have as many trade agreements as possible.
I played an earlier game on a smaller map where I assumed you were supposed to wait for decisions to come to you rather than go to the planet screen and nominate/bribe in your own behalf, and of course I won that one with zero effort. But I had trade agreements with half the galaxy.
In my current game with a larger galaxy and a huge number of species, I had figured out you can bribe to improve your chances of winning. I paid the maximum 2 bribes to where my candidacy was "strong", but a puny species off in the corner of the galaxy with no allies, no evident relations, and fewer pops than me kept winning it. I only had 1 trade agreement, however. I reloaded again and again, and it had the same results each time - same scrub kept winning.
So I reloaded to a year earlier and decided to set up another trade agreement (by bribing the target with energy first to get relations up). I also paid 1 of the 2 possible bribes to get my chances higher. Before I could even wheel and deal to get the energy credits to pay the second bribe, *clang clang clang* the market formed on my homeworld.
So again, my conclusion is that the number of trade agreements is the most important factor . . . assuming it's not just RNG. (And if that's the case I don't know why the winner was the same every time when I kept losing.)