It creates a shift in the mood, which was initially lighthearted, to one that is somber and tense.
The inheritors is a novel that narrates the story of neanderthals and its encounter with a group of homo sapiens, that thinks of them as uncivilized and savage.
This excerpt relates to the plot of "The Inheritors" in the way that it strengthens the conflict by revealing the severity of the punishments that one convicted of spying will face by mentioning specifically what will happen (at most 20 years) if they do something specified in the excerpt, which in this case is spying.