An underexposed negative will not produce enough silver in the shadows to print adequate detail, so the shadows will print as flat, textureless, muddy-gray tones
The thickest portions of the neg become the highlights in print; the thinnest parts of the neg become the shadows. The difference in density is the contrast index.
The important thing to remember is that the tone curve (neg density versus exposure) is
nonlinear... it has a quite linear central part, but then it has a "knee" and at the other end a "toe." This nonlinearity is the source of your confusion, I suspect. If the tone curve were linear then tones would just shift proportionally when you under/over expose. But the nonlinearity affects the tone separation when you under/over expose. So under/over exposure has different effects on details falling on different parts of the tone curve.
~~~
It is important to think a bit about what the slope of the tone curve means to how the tones will be rendered in print. Where the tone curve is very sloped, there will be more separation between adjacent tones. Where the tone curve is flatter (i.e. above the knee and below the toe) the tones will tend to clump up (=posterize). The latter situation is a major benefit of film (wrt/ digital) because there is a tendency for highlights not to blow in a specular way but rather to have a slow, smooth transition. What's so nice about film is how smoothly the tones ease into the knee and toe regions.
Now, how you expose and how you develop will determine where the tones of your scene fall on the tone curve. People may tell you to rate the film at some number different from the box speed; sometimes that is because they prefer more shadow detail or more highlight detail... or similar effects. It's worthwhile to listen to those opinions, but first and foremost, you should learn how to get full range and optimal detail (=good tone separation) across the tones! And usually that means placing the centremost midtones smack dab in the middle of the tone curve and developing normally. Simple.
You can also develop the film in such a way that there is less overall range or more overall range. You'd do this to build contrast or to reduce contrast.
~~~
Short version:
(1) In a well-exposed neg, the midtones will be somewhere around the middle of the tone curve;
(2) If you overexpose, the resulting neg will be too thick and the highlights will tend to clump together at the knee of the tone curve;
(3) if you underexpose, the resulting neg will be too thin and the shadows will tend to clump together at the toe of the tone curve.