Sparring competition in Karate is governed by a set of rules. That's why it isn't a real fight.
Which rules depends on who is running the competition.
Most sparring competitions are awarded points for good technique, issued quickly and cleanly and with the appearance of a warrior spirit. How many points for what type of technique will again depend on who is running the competition.
Some people swear by the idea of "one hit one kill" and so their competition revolves around a single point or two half points.
For others it is about the accumulation of as many points as possible with as many scoring techniques as possible. Often the more flamboyant a technique the more points it will gain.
And then there are knock-down competitions, often regarded as the hard-core because of the physical toughness one must have to take part, the rules here often outlaw punches to the face.
There isn't a fool-proof competition system. There are always circumstances that the rules outlaw and ways of winning which rely upon skill at applying the rules rather than skill at defeating an opponent.