The phone knows that the battery is a genuine Apple component, because the battery cryptographically identifies as one. What it's detecting is that a genuine Apple battery was installed in the phone, but not by Apple.
It displays the warning to scare the user and make them mistrust the 3rd party repairer. The only way to make that warning go away is to use a secret-sauce Apple programming tool that they withhold from 3rd party repairers and sue anyone that manages to reverse engineer it.
They are not doing this to protect you. They're doing this to make you distrust 3rd party repairers, or to make you avoid the nag warning, and go to their overpriced store instead.
I'd probably take objective measurements of physical properties over a "profile new battery" charging cycle, and not solely rely on supply-chain QA personnel, protected by DRM nonsense.
My charger for rechargeable AA (LR6) batteries can do that, recondition batteries to eke out a few more cycles, and also tell me when a battery is finally gone beyond its powers to revive.
And my charger is not a $1000 device that utterly relies on the health of its battery to function, either.
What Apple is doing is slapping an opaque cover over the report screen until someone comes along that has a company-issued "remove report cover" pass. What if someone put alkaline batteries in there, instead of metal hydride? What if they put in AAA batteries instead of AA?
The charger can detect wrong chemistry types, like alkaline and NiCd, by objectively measuring the physical properties. And it can still charge AAAs. They just have a lower capacity. The battery subsystem in the phone could analyze a new battery and report its condition, but that would require Apple to admit to itself that a battery is a 3rd-party replaceable part that will require replacement some time over the projected lifespan of the device.
How do you know? You measure. High-tech batteries have some of that capability built-in, and high-tech devices with charging circuits connected to high-powered general computing processors can certainly run automated tests after their case-intrusion sensors and/or power-interrupt sensors detect events.
Then it has a smaller capacity than a brand new battery should, but still larger than a heavily used battery. It's something the phone can report on, and android phones do. Apple can't guarantee your replacement battery was 'stored properly' either. All they can do is run their little programming tool to remove the warning regardless.
This scenario is completely outside the realm of 'new genuine Apple battery detected + no Apple warning reset = permanently harass the user with false warning'.
Let's be really clear here. The warning is 'unable to verify this iPhone has a genuine Apple battery'. Which is complete bullshit. The phone is perfectly aware that the battery is genuine because it carries a crypto signed identifier.
So if Apple rephrased this message to state, “unable to verify the health of this battery,” but still had the exact same system response, you would be happy?
I think the message could have been clearer. But to add to your point, wasn't there a case when car repair shops would rewind odometers on cars/engines to make them seem newer that they actually were?
It displays the warning to scare the user and make them mistrust the 3rd party repairer. The only way to make that warning go away is to use a secret-sauce Apple programming tool that they withhold from 3rd party repairers and sue anyone that manages to reverse engineer it.
They are not doing this to protect you. They're doing this to make you distrust 3rd party repairers, or to make you avoid the nag warning, and go to their overpriced store instead.
https://www.youtube.com/watch?v=GlvlgmjMi98