Among Undertale’s characters, Sans appears to be most experienced in dealing with humans. His level of knowledge is at Flowey’s level, despite a lack of abilities. For example, he knows about saves, but he can’t intrude into them.
This is why this little skeleton is skeptical and notices any strange movements of yours. If you load the same game save several times, or if you change the pacifist route to genocide, Sans will be the first to notice it.
And he is your final judge before the throne room of Asgore. If Frisk’s soul is clear, he wishes good luck to the protagonist and lets them go, but if their hands are stained, the fight is inevitable. Sans sends a ton of bones and blasters and breaks into the selection menu, all to stop the human from entering the chambers and erasing the underworld.