Sign-extending means the value of the most significant bit of the 16-bit integer (the sign bit, for signed 16-bit integers) is used to fill the 16 higher bits.
0abcdefghijklmno => 00000000000000000abcdefghijklmno
1abcdefghijklmno => 11111111111111111abcdefghijklmno
This means that if your 16 bits represent a signed integer, your 32-bit value will represent the same integer.
When you write
int16_t x = -5;
int32_t y = x;
the value gets cast up to a 32-bit signed integer using the sign extension described above. If zero extension were used instead, y would be assigned the value 65531, instead of -5.