The pitch of a sound is determined by the frequency of sound waves. Different regions of the basilar membrane within the cochlea vibrate in response to different frequencies, allowing us to perceive different pitches.