Identification friend or foe
An identification, friend or foe (IFF) is a device that transmits, either continuously or on demand, a signal that positively identifies an aircraft, ship, vehicle, or other platform as belonging to one's own side. Informally, it has been called the "don't kill me" mechanism. If an enemy could transmit the IFF signal, it could pass unharmed through air defenses that would kill it if they could. To prevent this, military IFF signals are encrypted, and change frequently. ATC transponders do not have this degree of security.
IFF assumes a cooperative relationship between the platform identifying itself, and the interrogator. If the IFF transponder failed, and the platform carrying it were shot down only on that information, it would be a case of fratricide. In battle conditions, IFF is usually not the only way to identify a friendly. For example, if the flight plans of all friendly aircraft are known, and the unknown aircraft matches one, the air defense controller might order a fighter to make visual identification.
What if the IFF fails?
Given that it is often highly desirable to attack a hostile platform as far as possible from your own forces, perhaps well beyond visual range (BVR), there are a number of techniques generically called Noncooperative Target Recognition (NCTR). Specific NCTR techniques are highly classified, but some that have been mentioned are using radar to count the number of blades in a jet turbine engine.