As already pointed out, civilian transponders are not really "IFF", they're a tool for ATC to keep track of you.
Military IFF transponders don't emit unless they get interrogated by a valid code, and then only briefly.
The interrogating plane would typically only interrogate if you show up as a radar contact, and at that point, being able to say "I'm friendly" is very useful. You're not hidden anyway.
Note that the name "Identification Friend or Foe" is misleading; IFF can only positively identify friendlies. A nonresponsive bogey (unknown) may still be a friendly with bent IFF, wrong codes, etc.
Military IFF transponders don't emit unless they get interrogated by a valid code, and then only briefly.
The interrogating plane would typically only interrogate if you show up as a radar contact, and at that point, being able to say "I'm friendly" is very useful. You're not hidden anyway.
Note that the name "Identification Friend or Foe" is misleading; IFF can only positively identify friendlies. A nonresponsive bogey (unknown) may still be a friendly with bent IFF, wrong codes, etc.