Audacity uses the SoundTouch library for the Change Pitch (changing pitch without changing tempo) and Change Tempo (changing tempo without changing pitch) effects. These are known as Time Stretching effects, because they defy the normal expectation that reducing the speed of the audio (thus increasing its length) will lower the pitch and vice-versa. Inevitably, some audible artifacts will be heard after applying these effects at more extreme settings.
Also, due to weaknesses in the algorithm, Change Pitch does not keep the length *exactly* as before. This can make Change Pitch unsuitable for changing the pitch of individual very short notes. In a similar way, Change Tempo can remove a very short length of content from the start or end of the selection, or not stretch the end of the content to the end of the selection when slowing down. Both of these symptoms may leave a short silence at the end of the resultant selection.
Current Audacity now has an alternative time stretch effect called Sliding Time Scale/Pitch Shift. This uses an alternative time stretching library known as "Subband Sinusoidal Modeling" (sbsms). Sliding Time Scale / Pitch Shift allows you to change tempo (without changing pitch) while simultaneously changing pitch (without changing tempo). It can also set a different tempo or pitch change value for the start and end of the audio. Artifacts are still expected at more extreme settings, although no length changes arise from changing pitch, and changing tempo should not result in removed content or silences at the end of the selection. Note: this effect is several times slower than SoundTouch and might not work properly on low-powered machines.