HP ink cartridges have either a microchip or an electronic strip depending on what printer you buy. both do the same thing in telling the printer how much estimated ink is left in the cartridge. This should always be taken with a pinch of salt though as you often find that once the cartridge says that it is empty you can still print several pages on before it has completely run out
Ask one of our cast of character bots