If it helps, try a simpler version. Just look at two neighbouring pixels in a row.
First example: There is 10 and 10. Difference between them is 0, no difference, no edge.
Second example: In the middle, there is 10 and 0. Difference is -10 because it drops from 10 to 0. There is a step of -10, that must be an edge.
The 3x3 kernel just takes the source pixel ...