The logic is hidden, and you are mostly right. We calculate your chances of a successful hit, but you aren't awarded the same damage every time, that is randomly determined from a range. Your Melee/ballistic modifer (skill) effects your ability to get a hit and the damage you do, but it affects them differently. (A hit with a rifle is not as greatly affected as a hit with a machete)
The advantage a horde has is that they attack as a group, so the player fighting three individuals may not have to defend three attacks, but only 1 or 2, while a horde attacks as a group.
Hope that helps