There are tiny protection diodes at each IO pin going to Vcc and Gnd. These typically cannot take more than a small current. So if the IO pin might be exposed to voltages higher than Vcc or lower than Gnd, then a series resistor can be used to limit the current below the maximum allowed. You don't write much so I can't say much more.
↧