What causes this strange noise in a pair of walkie-talkies? Let us suppose that Bob and Alice both have walkie-talkies. They are both 3m apart from one another. Alice pushes her walkie-talkie to speak but instead of speaking, she starts walking toward Bob. Both Alice's and Bob's walkie talkies are facing each other in the same general direction (speakers are in the same direction). Alice suddenly reaches a point along her path to which Bob's Walkie talkie creates a loud pitch screeching sound, Alice moves, even more, closer and the sound escalates in pitch, it becomes unbearable and she unclicks the speak button.
What is the cause of this high pitched sound coming from Bob's walkie talkie? Why only at a certain distance from Bob does the sound start?
Summary:

*

*Alice is 3 m from Bob when she presses the speak button and walks towards Bob, at a certain point a loud screeching sound can be heard from Bob's walkie talkie.


*She moves closer and the sound gets louder and higher in pitch.


*The walkies talkie speakers are facing each other the whole time.
This was a problem I came up with just out of interest and something I experienced myself.
 A: Niels nielsen's answer describes the phenomenon of audio feedback pretty well, but I'm not convinced by their explanation of your observation that the pitch of the feedback squeal rises as the radios are brought together.
In particular, if the sound you heard had a wavelength equal to the distance between the radios, as niels' answer seems to imply, then you'd expect to initially hear a low hum that only rises to a "high-pitched screech" when the radios are very close to each other, just inches apart.  But in practice, what I've observed (and what you also seem to describe) is the sound starting at a fairly high frequency as soon as the radios are brought close enough together to create feedback at all, and only rising moderately as their distance decreases.

Instead, I suspect that the rising pitch effect is mainly created by the frequency responses of your radios' speaker and microphone.  These responses tends to typically peak at a fairly high frequency, likely somewhere between 1 kHz and 10 kHz, and fall off more or less gradually both above and below that.

Frequency response curves of two high-quality professional microphones (Oktava 319 and Shure SM58) on a log-log scale.  Original image by Gregory Maxwell (© 2005) via Wikimedia Commons, used under the CC BY-SA 3.0 license.
Now, as your radios are turned on and brought close enough together, the loop gain will rise at all frequencies* simply because the closer the microphone is to the speaker, the louder it will pick up its sound.  At some point, the loop gain will exceed 100% for some frequency, and start resonating at that frequency.  And that initial dominant frequency will be the one for which the frequency response of your speaker and microphone, multiplied together, is highest.
Now, what happens next is that the volume of the dominant frequency will rise exponentially until it gets so loud that it starts clipping or, more generally, gets distorted by other non-linearities in your feedback loop.  This will always happen eventually, because otherwise the volume would increase forever without limit, which is obviously physically impossible.  And in practice it will happen in just a few feedback cycles, i.e. in a small fraction of a second.
This non-linear distortion will suppress the initial resonant frequency and stop its volume from increasing further past a certain point, but it also has another effect: it creates overtones at multiples of the original frequency.  And if those overtones can also resonate with gain over 100%, they'll do so and get louder until they, too, start clipping and distorting.
Now, at this point things get pretty complicated, since the different resonant frequencies will interfere non-linearly with each other. But what I'd intuitively expect to happen is that the final waveform this non-linear resonance process will converge to is most likely something close to a square wave with a fundamental frequency close to the highest frequency the system can resonate at, i.e. where the (linear, low-volume) gain of the microphone-speaker-microphone loop is just barely above 100%.
And, as I noted, the combined frequency response curve of the speaker and the microphone will generally tend to slope down more or less gradually above its peak frequency.  (How gradually will depend a lot on the specific microphone and speaker you have, and also on the electronics between them.)  Bringing the speaker and the microphone closer together will scale up the response curve, while keeping its shape otherwise more or less the same.  This will increase the frequency range over which resonance with over 100% gain is possible, and in particular raise its upper end to a higher frequency.  And since the non-linearities in the system will drive it to oscillate at approximately that frequency, what you'll hear is the pitch of the feedback squeal going up as the speaker and the microphone get closer together.

*) Technically, the exact length of the audio path between your radios (and any phase shift introduced by the radios themselves) also matters, since in order for a frequency to experience stable resonance, it must arrive back to its starting point at the same phase as it originally left it.  If there's no phase shift in the radios themselves, this effectively means that the distance between the radios must be a multiple of the wavelength of the resonant frequency.
In practice, though, this makes fairly little difference, at least when the radios aren't right next to each other.  To see why, note that the speed of sound in air is around 340 m/s, which means that a 10 kHz sound wave has a wavelength of about 3.4 cm (≈ 1.3 inches).  If your receivers happen to be, say, exactly 3.4 meters apart, then exactly 100 wavelengths fit between them at 10 kHz, so 10 kHz is indeed a resonant frequency for this system.  But so are 9.9 kHz and 10.1 kHz, since for those frequencies the distance between the speaker and the receiver is exactly 99 or 101 wavelengths respectively, and indeed so is any frequency that happens to be a multiple of fundamental frequency of 100 Hz for this distance.
Now, if you move the radios a little, this fundamental frequency changes a little as well.  But as long as it's fairly low — say, a few hundred Hz — then you're likely to still find plenty of integer multiples of it in the resonant range of a couple of kHz.  And one of those — most likely the highest — will be the main frequency you'll hear in the feedback squeal (along with its overtones created by the non-linear distortion).
A: It's called feedback . Here is what happens:
When Alice presses TRANSMIT, it turns on the microphone in her radio and hence begins to transmit any noise that hits the mic. With Bob's radio on RECEIVE, its speaker is turned on and it plays out anything that it receives at that moment- which in this case is the audio signal transmitted from the mic in Alice's radio, which responds to any sound source near Alice.
As Alice approaches Bob, her mic begins to detect noises coming from Bob's speaker, which her radio then transmits to Bob's radio, which plays it through Bob's speaker, which is picked up by the mic in Alice's radio, etc., etc. and the signal gets looped around and around and around, getting stronger all the while as Alice gets closer to Bob.
The critical case for best looping happens when a sound in the loop has a wavelength in air approximately equal to the distance between the two radios, which at 10 feet is about 100Hz, at 1 foot it is 1000Hz and at 1 inch it is about 12,000Hz, so the pitch of the feedback will go higher and higher as the radios approach one another.
