A lot of people have troubles when trying to understand how a capacitor works. It is necessary to understand the capacitor from two different perspectives if you really want to know it well. First you need to understand it from a practical perspective, and then you should understand it from a physical perspective. I will try as well as I can to explain it from a physical perspective.
A physical perspective
A simple capacitor is made out of two plates of a sort of metal. When you hear people saying that the capacitor is charged, it means that these plates have a charge on themselves. Charge means electrons or a lack of electrons on the plates (since it is in a metal). These plates are placed very close to each other.
But then, what happens if you connect a battery in parallel with a capacitor? - A battery is a device which tries as well as it can to maintain a certain potential (voltage) between its two poles. The battery will therefore in this case pump out a charge to the two plates until these generates an electric field between themselves which leads to a potential with the same value as the voltage of the battery.
Imagine that you have two plates a distant apart and you connect them to each of the two poles of a battery, and later you move the plates towards each other. What would happen? - When the plates are a distant apart, they do not need to generate a very strong electric field in order to maintain the same potential between themselves as the battery. And since the electric field is directly proportional to the amount of charge on the plates, they do not need much charge on themselves to get the correct potential. In fact, they can not get more charge on themselves than is absolutely necessary in order to get the same potential as the battery.
Afterwards you move the plates closer together and meanwhile monitor how much charge that is present on them. What you will observe is that the charge will rise on both of the plates while you lead the plates towards each other. That arises from the fact that since the distance between the plates gets smaller, the electric field that they generate must be stronger in order to maintain the same electric potential (voltage) between them. And this results in that the closer you have the plates, the more charge you will be able to put in the capacitor.
In a common capacitor you also have another issue, and that is the material between the plates. Since you perhaps want a capacitor having a large capacitance compared to its physical size, you can use a material different than air. These materials have a higher permitivity. This difficult word can be explained by that they allow more charge to be present on the plates when the same strength of the electric field is present between the plates. This means that you can keep the distance between the plates a little bit higher and still have the same capacity of charge on the plates (capacitance).