In edge detection, what value is being compared to the threshold value? When we say we set a threshold to the edge finding, what values are we exactly thresholding on? I know a threshold value to limit only certain edges to show up, but what value of the edges is compared with the threshold?

In both the sobel and canny edge detection, they are comparing with a threshold value but I am never sure what values of the edges are being compared.
Its simple. The gradient matrix is computed while performing the Canny/Sobel edge detection. No the gradient varies according to the edge. When you digitize this gradient function, you get a value which tells the magnitude of the gradient at that point.

When you threshold. These magnitudes are compared to the threshold value. If you want weak edges, you keep low threshold values. In such a case all minor edges will show up as well.
If you want only strong 'clear' edges, then you keep higher threshold values.