Question about boxing/MMA scoring

As I understand it, boxing and MMA (at least the UFC) has a ten point must score system. The winner of a round gets ten points and the other fighter gets nine or less. It’s unclear to me whether the winner is determined by the number of rounds won or the number of points scored. Also wondering about a situation in which a fighter for whatever reason is docked a point by the referee. Which I guess would be answered depending on whether it’s points or rounds that determine the winner.

It’s scored by the round, which are scored by points.

Link to the rest of the rules.

It’s by points. And yes, one big reason they’re ten points each is because points can be deducted for fouls like low-blows. So the guy who’s winning can actually drop himself back down by avoiding the fight to run out the clock, etc.