The stats/betting companies have spotters Nick.
Literally all they do is record every conceivable stat-they watch the game impassively.
Difficulty appears especially with XG when judging an attempt on goal-it literally boils down to spotters interpretations of how difficult a shot would be...