The ICAO24 code (sometimes called the Mode S code) is a 24-bit unique number that is assigned to each vehicle or object that can transmit ADS-B messages. It is usually transmitted by aircraft but some airport ground vehicles and multilateration towers also have ICAO24 codes assigned to them.
The number is usually shown as a six digit hex number, e.g. 400E74.
Although the number should be unique mistakes can be made when it is programmed into aircraft transponders, and more than one aircraft can end up transmitting the same code.
Aircraft do not keep the same ICAO24 code for their entire lifetime. The code is assigned by a country's registrar so if an aircraft changes registration it might have a new code assigned, and if it changes its country of registration it is very likely to be given a new code. Old codes can also be recycled and assigned to other aircraft, vehicles or mlat towers.
Blocks of ICAO24 codes are assigned by ICAO to the registrars of various countries so it is usually possible to infer from the ICAO24 code the country of registration. Some countries then use blocks of their allocation for military aircraft so it is sometimes possible to infer whether the aircraft is military from the ICAO24 code.