In an underdetermined linear regression setup, why does the residual sum of squares equal 0? In an underdetermined linear regression where the parameters to estimate outnumber the observations, why is it the case the residual sum of squares, defined as:
$$
RSS = \sum_{i=1}^n (y_i-\widehat{y}_i)^2
$$
equal zero?

That need not be the case.
It is routine to say that a polynomial of degree greater than the sample size will give a perfect fit to the data. However, this will not be the case if two points have equal feature ($X$) values but unequal outcome ($y$) values. No function can accommodate that. At least one of those points will have a fitted value $\hat y_i$ not equal to its observed $y_i$ value, thus a strictly positive squared residual.
EDIT
For example...
X  Y
1  1
2  2
3  3
3  4
4  5
5  6

No matter what a model predicts for x = 3, that model will make a prediction that is incorrect, resulting in a positive sum of squared residuals.
This really has nothing to do with $p>n$. If you have two instances with equal feature values and unequal outcomes, the model cannot ever get both right.
x1 x2 x3 x4 x5 x6  y
0  0  0  0  0  0  1.1
0  0  1  1  1  0  0.8
0  0  0  0  1  1  0.3
0  1  0  1  0  0  1.1
0  1  0  1  0  0  0.5

The final two rows have identical feature values yet different outcomes, so a model will get at least one of those wrong, leading to a positive sum of squared residuals.
