How is energy "stored in an electric field"? My physics teacher told me the statement "The energy of a capacitor is stored in its electric field".
Now this confuses me a bit. I understand the energy of a capacitor as a result of the work done in charging it, doing work against the fields created by the charges added, and that the energy density of a capacitor depends on the field inside it. But how exactly do I interpret energy being stored "within" a field?
I saw that there have been similar questions asked here, but I wasn't able to understand the answers clearly, or found them unsatisfactory.
 A: Very incorrect and oversimplified but somehow intuitive:
Nature tries to "equalize" many "things". For example temperature. Water in every place within a bucket will eventually be at the same temperature. If you start heating the bucket from below you will get convection currents that will try to equalize the temperature.
The same can be said about electrons. Nature tries to distribute the charge equally. If the charge is not distributed equally you can extract work from the movement (like in a battery).
You could imagine the electrons suspended on rubber bands in the middle between capacitor plates. When you charge the capacitor the electrons move to one side and the bands are under tension. The tension of the imaginary rubber bands is the energy stored in the electric field.
A: If you look at our equations for energy, you will see that they typically settle into two major categories:

*

*Energy associated with intrinsic properties of a "thing"

*Energy associated with the relative positioning of objects in the system.

A baseball flying through the air has some energy associated with its intrinsic nature.  It has a kinetic energy.  It has some chemical energy.  But it also has some energy associated with its position - gravitational energy.  Now at first glance it seems like this could be treated as a property of the ball, but let's do a thought experiment.  Let's have Bizaro shove the Earth away.  Maybe he sends it careening into the sun.  That's a good supervillain ploy.
Did this change the gravitational potential of the baseball? It certainly did.  But the baseball itself didn't change.  So if the baseball didn't change, but its gravitational potential did, then it's pretty unreasonable to consider it to be a property of the baseball.  It's a property of the Earth-baseball system.
The electric field is the same way.  An electron is an electron, no matter where you put it.  Its intrinsic properties do not change.  But if you have two electrons, their relative relationship leads to a potential energy.
This can get confusing, because we regularly look at multiple levels of detail.  At a high level, a capacitor is a "thing" that has an intrinsic property "potential energy due to charging."  But if you look at it at a lower level, you see that that "potential energy due to charging" was actually a property of the relative positions of electrons in the capacitor.  And this leads to an understanding of "parasitic capacitance," which is what happens when you accidentally bring two wires close together, and the relative positions of the electrons in both wires results in a capacitive effect you may not have planned on when building the circuit.
Realizing this is just a back and forth of modeling and approaches, rather than physics, is helpful.  I know I was always very frustrated when I heard the term "phonon."  A phonon is a particle of sound.... which is absurd because I know that sound is a wave mechanic, not a particle mechanic.  But I also am wrong.  Sound isn't a wave mechanic or a particle mechanic.  Sound is sound.  I associate a mechanic to it to aid in solving equations.  And, as it turns out, there are some times where it is very effective to treat the energy of sound as an intrinsic energy of a "phonon" that propagates through space.
A: The stress-energy tensor
At every point in space there is a density: Build a sphere (or any shape) of gravity sensors and measure the net acceleration into the sphere (technically the surface integral of F/m*dA). For normal matter greens theorem means you get the total mass inside regardless of external masses.
Note how I said "normal matter"? The actual measurement is mass + 3 volume pressure. For normal matter the volume-pressure (which has units of energy) is far smaller than the mass. But for fields and light this is not the case.
What we actually have at each point is a stress-energy tensor which enters directly into general-relativity. This tensor bundles up density, momentum flux (i.e. a moving river) and stress (tension/compression/shear) all into one 4x4 symmetric matrix. A gas of photons has is under hydrostatic pressure equal to 1/3 of it's (energy) density (denoted as w=+1/3). An electric field has w=-1 in one direction like an extremally lightweight string under tension. This tension pulls the plates together in a capacitor.
The entire stress-energy tensor Lorentz transforms and so can be deduced by modifying our sphere experiment to measure the gravitational accelerations of objects moving at different speeds in different directions.
This all sounds abstract, but for a charged black hole all the energy and stress in the electric field around the hole modifies the spacetime curvature: particles even if uncharged will orbit differently.
A: This question is deeper than you might expect. Neither energy nor an electric field is exactly what you might expect.
First, physics is a description of the behavior of the universe. It is not the universe itself. There are a number of different versions of physics - classical physics, quantum mechanics, relativity, etc - that describe different pieces of the behavior. None is perfect. We don't even know the total behavior. They are all pretty good.
It is common to think of energy as some sort of stuff that can live inside a moving object as kinetic energy. Or get stored in a stretched spring. It can be transformed but never created or destroyed. This point of view works in that it give the right answers. But energy isn't real. It isn't a thing in the universe. It is a tool to describe the universe.
We stand by the road and watch a car drive by. The car is moving and has a lot of velocity and kinetic energy. The drives sits in the car. He says the velocity is $0$. The seat is under him now. A while later, the seat is under him. It hasn't moved. If the velocity is $0$, so is the kinetic energy.
Both we and the driver are right. We are free to pick a frame of reference. As long as we stick to our frame of reference, we can use the tools of physics and get right answers. But you don't think of velocity as some sort of stuff that lives in a moving object and is gone when the car stops. If you are thinking about multiple frames of reference, thinking of energy this way doesn't work either.
On the other hand, if you do stick to one frame, it works just fine. So your teacher is right. It is a good, intuitive way to describe the universe. But it can get confusing if you ask too deeply just what it is.
Feynman compared energy to an accounting system. Here is a post that talks more about this point of view. Basic energy question
If we stick to one frame of reference, we always get the same answer for how much energy there is. We say that energy is conserved. We can say something similar about water. You can move it from place to place. You can evaporate it and move it into the air. You can condense it back to liquid. But you always have the same amount of water. Water is conserved. So thinking about energy in the same way you think about water makes it easier to understand energy.

The electric field is another tool of physics. This one helps sort out the forces between electric charges. Here is a post that describes it. In what medium are non-mechanical waves a disturbance? The aether?

Physicists get so used to thinking in terms of energy and electric fields that they forget they are tools and not the universe itself. They do talk about energy and electric fields as real things. They say the reason why that a moving object slows as it compresses a spring is that energy is conserved. They say the reason an electron accelerates is because an electric field exerts a force on it.
The purpose of these tools is to work so well, to match the behavior of the universe so well, that you can forget the difference. This helps make the universe understandable.

Responding to comments
People have brought up some valid points. This isn't something you need to pay attention to. You can do physics without it. So why did I bring it up?
How can a field be real, but not a photon? Or how can a charge be real, but not a field? Or field vs chair? How about the magnitude of the energy-momentum 4 vector? All good questions.
Let us agree that the universe is real and contains something. Physics is a model of the universe and contains mathematical descriptions of the universe that are different from the universe itself. If the descriptions are good enough, we need not care about the difference. It does matter if the descriptions don't match the universe in some important way.
There is a common view that energy is some sort of stuff that lives in objects or systems, and the total amount never changes. This view works from one frame of reference, but falls apart when you change frames. The OP was having problems understanding how this energy stuff could be stored in an electric field. It seemed that pointing out that energy isn't stuff would help with that.
But I have gotten a bit carried away in the comments. There is difference between what we think of as a chair and the thing that would exist even if we didn't think about it. But we don't need to worry about that difference when we sit down. Likewise we can use our models and do physics. Most of the time, getting nitpicky about what exists is getting away from physics and into philosophy. You might care about the difference if you are looking at the limits of where a model can be applied.
Let's just leave it at this: For every nonreal phsyics concept, there is a feature of the universe being modeled. Or at least approximated. If that feature is a repeatable pattern of behavior, or law, the question of whether is is "real", if it "exists", is more semantics than physics.
A: The energy in an electric field is a measure of the "disturbance of the universe".  Its volume density for linear media is $\frac12 \vec{D}\cdot\vec{E}$.  Now $\vec E$ is a differential in energy for a unit charge to move in a particular direction, and $\vec D$ is an "indicator field" where a closed surface integral of it will reflect the enclosed unmatched charges.  So if you were to disperse them and undisturb the universe, it would entail moving the charges indicated by $\vec D$ against the (usually simultanously diminishing) force density impressed on it by $\vec E$.
Now this view of the electric field makes it an indicator of the energy flow.  However, thinking of them as indicator falls somewhat short in that it turns out that they are the sole mechanism we can really find for energy interactions, and if you manage creating fields without matter or charges, the energy flows are still the same.
So there is some point in saying that the energy is stored in the field because storing energy does not work separately from the field.
A: The idea is that all energy, including kinetic energy and EM energy (such as that stored in the capacitor) is localized in space, i.e. given any region of space, one can assign net energy to it, and even say how much of that is EM energy. With kinetic energy, this is natural - the seat of kinetic energy is the space region where the moving body is. With EM field, it is similar, but not so discontinuous - EM field does not usually cease to exist just outside the body or a chosen well defined volume. In general, it is non-zero everywhere in any chosen volume and only continuously fades away when going away, far enough from the volume.
For given EM field, there are various alternative ways to distribute EM energy in space so that all necessary conditions are satisfied. But the simplest, natural and most useful option is the Poynting energy formula, which assigns to any point of space EM energy per unit volume
$$
\frac{1}{2}\epsilon_0 E^2 + \frac {1}{2\mu_0}B^2
$$
where $E, B$ are magnitudes of net electric and net magnetic field at that point.
That is, in this picture, one must consider some finite volume of space in order to get non-zero EM energy. Poynting EM energy stored in a point or a line or a plane is zero.
A: If we transfer one small $dq$ charge from one capacitor plate to other, then we need to do some work. Repeat the process like this again and again; this leaves a net negative charge on the first plate and builds up a positive charge on the second plate accordingly. When the charge increase, the mean field strength between the plates also increases, so we need to do progressively more work to transfer the charge as the process continues. The work done against electrostatic force to move the charge from one plate to the other is the store energy, which can also be represented in terms of the electrostatic field that has been built up inside the capacitor.  The is equivalent to the electrostatic field storing the the energy.
A: It's a model, created to capture what is seen in experiments. If we attribute the energy of an electromagnetic interaction to the fields, we get the right answer. We don't have an alternative that works. There is no deeper explanation.
A: What "is" an electric field?
One way to look at the world is to see it as a cellular automaton; something resembling Conway's game of life. Of course it's not so simple — the playing field looks different from observer to observer, everything is fuzzy etc. — but as a mental model it's quite productive.
Each little volume has a set of properties which interact with other properties and propagate with each "tick" (only) to neighboring cells, thusly establishing the speed of light.
Such properties are essentially a set of "influences" on various kinds of "particles"1: Charges are attracted, repelled or deflected. Matter is attracted. Quarks are glued together. These "influences" are what we call "fields" in a macroscopic view. Fields are properties of points in space time that describe how this point in space time interacts with "particles".
How can a field store energy?
One of these is the electrostatic field, for example between capacitor plates. It can accelerate charges, which means that it gives them kinetic energy. The field can do work on matter; that is why we say it "contains" that energy. Like all energy it is conserved: Charges flowing along the field will weaken it until its energy is gone. "How" exactly it stores the energy is a somewhat meaningless question: "How" does a missile store its kinetic energy? Fields and their energy are properties of spacetime volumes; that is all we can say.
While "fields" (i.e., spacetime properties) are "concepts" they do have a certain reality (beyond the fact that we can measure "their" effect, which is somewhat circular): Their energy actually makes the space heavy, although that wording is a bit awkward: Energy is mass, so it doesn't make anything heavy, it is heavy. If you want a bit of pop science, a magnetic field strong enough could conceivably be "heavy" enough to produce a black hole, unless something else happens first, like spontaneous pair production etc. There is no principle reason why this should not be possible with other fields as well.

1 I'm putting "particles" in quotes because what we call "particles" is, at a closer look, a volume with special set of properties that just happen to perpetuate themselves, sometimes infinitely, sometimes not.
A: The energy is not really anywhere. It's like saying where is the momentum? it's not something you can see or touch; it just happens to be a conserved quantity that is useful. There are many gimmicks and tricks to calculate such quantites and some otehr visual aids, but those are not fundanental. You should think of energy mathematically, not as some ghost material that floats into space.
