The Sobel Filter help us get the edges of an image by computing an aproximation of an image gradient.
By convoluting an image with the first kernel from left to right we get the Gradient in the X direction
Then by convoluting an image with the first kernel from top to bottom we get the Gradient in the Y direction
At this point we have the vectors of the gradient of the image. Now by finding the magnitude of each vector we will get the edges we need.