From what I've seen, playing various modes, the priority of winnings go to - Whoever has the most stocks. When that ties, then to whoever has KO'd the most people, then when that ties, whoever has done the most damage. It has little to do with how much damage you have at the end. (however I'm not certain if on FFA stock matches that whoever has the most stocks left wins over someone who KO'd the most people)
This is why, sometimes it's better to rack up damage on your opponent than to go for an early KO in a match you feel may drag on.
On FFA I found interesting to note that if someone has 3 KOs and 2 falls, and someone else has 2 KOs and 1 fall, though their points technically tie, the person with the most KOs wins, even if the second person did more damage.
But yeah it's simpler to follow on 1v1 and not entirely fair but eeeeeeeeeeeeeeeeeeeeeh