IFF is an acronym meaning Identification Friend or Foe.
A transponder-based system of aircraft identification, used to distinguish friendly craft from enemy craft.
The system essentially uses a "Question and Answer" routine between one aircraft and another. A correct response leads to the questioned aircraft being identified as friendly. In this respect, IFF can be considered a Challenge-response Authentication system.
The interrogation process is undertaken automatically, with no direct pilot / operator intervention necessary.
IFF systems can also be incorporated into missile and or defence systems, thus preventing them from firing on / acquiring "friendly" targets. IFF transponders may also be fitted to civilian aircraft for the same reason.
Colonial civilian and military ships, such as Vipers, also have transponders. The civilian ships likely use civilian transponders used for commercial passenger flight.