Excellent question...Grasshopper...Where do photons come from...what are they...and why are they so important?
At a conceptual level, in order to really understand where photons come from, we have to take a quick look at the atom. And for those in need of a quick refresher...an atom is an extremely tiny particle of matter.
While there are smaller pieces to an atom, the atom (for our purposes) is generally considered the smallest unit of matter that defines the chemical elements we know and all of their and their isotopes (variations). Every substance known to us in the form of a solid, liquid or gas is comprised of an atom or multiple atoms (molecules). They are the fundamental building blocks of our physical world on earth.
Breaking down an atom further, every atom we know is composed of three essential parts. There is the very dense nucleus in the center which is made of protons and neutrons (except for the hydrogen-1 atom, which has no neutron). The protons and neutrons are held together by the nuclear force.
Surrounding the nucleus, is a cloud or of either a single electron or multiple electrons which are bound to the nucleus by the electromagnetic force. These particles are flying around the nucleus at an incredible speed. They are also flying around in different "layers" or altitudes from the "surface" of the nucleus.
The nucleus, we know that there are two kinds of particles. One particle is called the neutron and it has no electrical charge. The other particle is called the proton and it has a positive electrical charger. The electrons that float around the atom's nucleus at tremendous speed creating what is described as orbitals, which are negatively charged and tightly bound to the nucleus.
The orbitals surrounding the nucleus are moving around at different levels or altitudes because each orbital is associated with a different level of energy. The electrons creating the orbital that is located the furthest away from the nucleus have the most energy. Orbitals closer to the nucleus have gradually and slightly less energy (See diagram below).
At the atomic level, the electrons are orbiting the nucleus at the speed of light. But electrons can for various reasons also jump between orbitals, which requires energy to do so. If an electron jumps from an inner orbital to an outer higher energy orbital, the electron uses energy. However, if an electron jumps from an outer orbital to a lower energy inner orbital, this process gives up energy or releases energy. This energy is released as a tiny packet of light energy, or what we know as a photon.
A photon is the product of electrons moving closer to an atom's nucleus resulting in a corresponding release of energy. The YouTube video below, filmed by Paul Volniansky and explained by Steve Jones (an experienced mathematics and science teacher), elaborates more on this process of creating a photon through orbital changes.
The Aurora Borealis, also called the northern lights, is another celestial example of photons and light begin created from particles clashing with the magnetic field of earth.
When certain atoms, as Steve Jones mentions, are excited they create light or frequencies of light that we can see. Some frequencies of light are not visible. Different colors of light are created too as they correspond to different levels of photon energy when excited and released.
Within our local star, the sun, this type of reaction and/or excitement between electrons causes the creation of photons and light on an astronomical scale, and the earth and our entire solar system are constantly bombarded with photons at various waves of energy levels. The bright light and warmth we feel each sunny day as we face the sun are the photons from the sun finally reaching earth and our skin.