I've had this happen to me since the 4 came out. I don't think the 3GS did it.
It would charge over night, still plugged in 100%. Unplug it, 99%. Restart phone, back to 100% and functioning normally.
Its like the battery and software can never get perfectly synced with eachother.
It gets better the older the phone gets, and eventually seems to stop doing it.
Its got no affect on battery life though, i've always got excellent battery life.
my 4 has done this from the start also. its sporatic, but never an issue.