Not sure it was democracy Mikey.
As stated above, Farage won the election in the UK and he supported Junckers. Yet the UK vote was against Junckers.
The EU were aware that an anomoly plays out where the heads of Government often have few MEPs yet got to pick the commissioner. In 2009, Labour came third in the Euro elections but Gordon Brown got a say in choosing the commisioner, and Cameron who had the most MEPs didn't. That is clearly undemocratic.
So they decided at this election that the group with most votes would nominate a candidate. The other groups could nominate a different candidate, but in reality the group with most MEPs would win. After the fact, Cameron insisted the heads of Government should take a vote (in the past there was no vote, just a decision based on the consensus of their discussions). And the rest is history.