I do believe for a fact that some teams are favorites from the beginning of the seasons when the draw is made,strange matches that we call trolls I suspect happen to favor them or the already predetermined events , I don't know what the game takes into consideration other than the team quality (I suspect highest quality player, the amount of good players a team has not based on their skills but day to day performance ,previous competition successes,maybe transfer activity etc). I and many also noticed that no matter where I finish in the league most of the times the last match is against a direct rival for the place.