This is more of a chemistry question, but the basic idea is, well, chemistry.
A capacitor imposes an electric field around a dielectric, which can only store energy until it breaks down (typically a runaway ionization process). Ionization requires a few eV/atom to occur, but it can be triggered at much lower field strengths per atom/molecule, because a free charge moving through the dielectric is accelerated by the field and able to cause much more damage (i.e., an avalanche cascade).
Thus, capacitance is limited by surface area, and surface area is limited by how well it can be connected (the metal has to be nonzero thickness), and the minimum thickness of dielectric required to hold off the rated voltage.
There are also mechanical limitations, like for very low voltages, dielectrics can't be made thin and perfect enough, and density tends to suffer. Across most dielectric types, modest-voltage capacitors (a few hundred volts, ballpark) have the best CV2 (energy) product per volume. CV (charge) also tends to go up with rating.
Whereas batteries store energy by chemical reaction: a redox potential of up to several volts per atom, and thus several eV per electron exchanged. Not all atoms in the electrodes can participate -- some structure must remain to be restored during charging, for reusable chemistries anyway -- but a sizable fraction can, and with several eV/atom, the density is vastly higher. The downside is, it's a material-transport limited process. Diffusion being the dominant transport mechanism on the smallest scales (which is directly sensible as the Z ~ 1/√f internal impedance characteristic of most batteries). Material transport is also part of why rechargables wear so notoriously (as mentioned above, some structure is required, but that structure gets distorted as material is cycled through it), among other reasons: there are also side reactions, like lead-acid sulfation, or lithium ion metal dendrite formation or electrolyte decomposition, etc.
Is there an inbetween case? Yes! We can cause ions to migrate subject to an electric field (double layer effect). The maximum potential is quite low (comparable to battery terminal voltage: 2.5V or so for typical electrolytes in use), but this corresponds to the energy per ion, roughly speaking. The hard part is influencing enough ions to make a dent. And this is where surface area comes into play: an extremely porous material like activated charcoal, which also happens to be conductive, serves as the electrode. Downside: the pores are extremely deep, so it takes a very long time for charge to equalize.
A typical experiment is to take commercial ingredients (activated charcoal, salt water, ionic membrane) and construct such a capacitor; while the capacity is impressive for such meager materials (it can be in the kF/cm3 range!), the charge rate is incredibly low: you'll only measure such large capacitances over time periods of days. (Water is also a poor electrolyte, breaking down at ~1.2V. But within that 1.2V range, yeah, it works.)
There are even more direct hybrid types, which I don't know the particulars of, but a good jumping-off point is Supercapacitor | Wikipedia.
In general, speed and density are in an inverse relationship. Transmission lines, and ceramic and film capacitors, are the fastest possible materials and structures (sub-ns to µs). Type 2 ceramic and cheaper grades of film are denser but slower (~µs), and aluminum electrolytic slower still (~µs to ~ms). Supercaps are slower still (~s), and batteries slowest (~ks).