Doing guard duty gives you a lot of time to spend staring out into space thinking about your life choices.
For example, Wen Ning spent a lot of time thinking about his life choice to betray his family in order to help the boy he'd been in love with for a year. Wen Ning had spent much of that year entertaining himself with fantasies that Wei Wuxian returned his affections and someday they'd meet at a night-hunt and Wei Wuxian would heroically save him from a monster but not before Wen Ning got a picturesque injury that made Wei Wuxian confess his love for fear that he'd never get another chance, because Wei Wuxian didn't know that Wen Qing was the best doctor in Qishan and could save Wen Ning from even the most horrifying injuries. However, once Wen Ning had actually spoken to Wei Wuxian again, it had been suddenly and acutely obvious to him how stupid his fantasies were.
It was the most important moment in Wen Ning's life, because no one was ever nice to him, but it was completely unmemorable to Wei Wuxian, because Wei Wuxian was nice to people all the time. He thought of Wen Ning no more often than he thought of the bartender at his favorite tavern. Maybe less. Wei Wuxian really liked his drink.
The worst part, Wen Ning had decided after many nights of rumination, wasn't the murder threat. Wen Ning could forgive a murder threat; after all, Wen Ning's family had just killed Wei Wuxian's entire family. It was the look of blank incomprehension when Wen Ning shared his name. It was one thing to be someone Wei Wuxian hated; it was another not to be thought of at all.
To be honest, Wen Ning might not have continued betraying his family after this revelation, except that he'd already started and it seemed very awkward to change his mind about it halfway through the treason process.
Wen Ning didn't kill anyone from the Sunshot Campaign, because he was very possibly the most cowardly cultivator in the world, even considering that the world contained Nie Huaisang. That is why he was assigned to guard duty at the Wen Clan's least interesting fortress; when they tried to put him in battle, he didn't. Couldn't. Something just stopped him from killing people.
Wei Wuxian didn't return the no-killing favor. Wei Wuxian killed Wen Ning's meditation teacher, and the woman who'd separated him and Wen Chao whenever she saw Wen Chao bullying him, and the man he brought healing herbs to when Wen Qing had extras. And then he harnessed their bodies as fierce corpses and sent them to kill Wen Ning's cousins and uncles and aunts.
It was hard to take offense. This was what war was. But Wen Ning couldn't stop thinking about how if he hadn't saved Wei Wuxian, then Wei Wuxian would be dead, and Wen Ning's meditation teacher and the woman who saved him from bullies and the man he gave herbs to and innumerable cousins and uncles and aunts would be alive. Presumably this is why you were not supposed to commit treason, even if the person you committed treason for was kind to you.
But if Wei Wuxian was dead, he wouldn't smile at Wen Ning, and Wen Ning wanted very badly for Wei Wuxian to smile at him again.
Wen Ning wasn't a very good guard, so he didn't notice the hole swallowing him up.