Lightning accessories have a chip inside that can confirm certification but chargers are a different thing altogether.
The iPhone can draw 1/2 an Amp (it does this when hooked to a USB port) or it can draw 1-Amp (when hooked to AC). Similarly, the iPad can draw 2A or 1A.
If the phone tried to draw 1A from a charger that couldn't provide 1A there could be some damage.
So how does the iPhone know? The charger tells it.
Apple uses a non-standard USB setup and the iPhone/iPad actually looks for a specific amount of power coming into it on the data wires (in addition to the charging wires).
A USB port on a computer or similar won't have the correct power on the data wires and the phone will draw 500mA.
A charger designed to Apple specs will have just the right amount of power coming in on these wires and the iPhone will know that it's safe to draw 1A.
This power spec is very specific and if the power is off by just a little the iPhone will give you that accessory error. I think I remember it being less than 1/2 a volt.
And even if the charger is putting out the right voltage, using a non-Apple USB cable or a damaged cable could alter that voltage just enough to throw off what the phone sees.
It may drop down to the 500mA charge rate or it might not charge at all. It probably depends on how "off" that voltage is.
That power setting is in the Apple firmware and it can change with every iOS update.
My car stereo used to charge my iPhone just fine.
Then there was an iOS update and the car stereo stopped charging.
On the next iOS update it started charging again.
I already know that the settings in the iPad have changed in beta-2 because I noticed it trying to draw 2A from 1A chargers.
That is pretty dangerous and I expect it to be corrected before the final iOS7 release.
In the meantime I would recommend that only the offical iPad charger be used with the iPad.