Loose, worn and corroded car battery cable terminals can cause problems that make you think you have a dead battery. All three of the mentioned conditions can make it much harder for your car’s battery to be able to supply a sufficient amount of power to start the car’s engine and also to accept a charge from the alternator. You can test whether the problem is your battery terminals or the battery itself by disconnecting both terminals. Making sure the battery is fully charged and, using a battery load tester, check to see if the battery is capable of maintaining a charge under load. If the battery maintains an acceptable voltage under load, then you most likely have bad terminals.
For more info, see How Does a Lead Acid Car Battery Work