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).