Friendly target identification in radar
Every system will be different, so it’s impossible to make a blanket statement that applies to everything, but IFF systems can be used to accomplish the task. The signal processing here can be as basic as looking for a predetermined pulse pattern, or require demodulation/decryption of some “special” signal. The Wikipedia article I linked covers the topic in pretty great detail.