This happens because there’s gunk on your AirPod or in your AirPods case so the metal on the AirPod isn’t making contact with the metal in the charging case. The number of people I’ve told that to when they thought there was a hardware defect is incredible.