Do they just store them somewhere? Do the photons get formed from energy?
The photon itself is probably best imagined not as a physical particle but as an excitation of the underlying electromagnetic field.
It is like looking at someone sitting on the edge of a pool kicking their feet and asking where their feet keep the waves.
Do you store the sounds and speech in your body before you make them? Or do you create the sounds/speech as and when you desire? When a balloon pops is the sound “stored” in the balloon “escaping”? This is probably similar (not identical) to what you’re asking (although subatomic particles don’t have “desire”)
It seems like something is created out of nothing but a lot of what we call “particles” are, in the modern interpretation, excitations in different fields. This is the weird and wonderful world of modern physics.
If you believe fields have physical reality, then there are no particles per se – there are fields, and excitations in those fields *are* particles. The electron field and photon field affect each other, and one of the things they can do is allow the electron excitation lose energy while a photon excitation is formed in the photon field.
If you want to talk purely in particle terms, then the photon is just plucked from the vacuum. We don’t really need an underlying physical model for *where* it comes from to make accurate physical predictions.
The second guess. Electrons don’t “contain” photons. But if they are in a situation where they can get rid of energy, eventually they do. And one of the main ways that they do so is to emit a photon.