Anti-matter are simply particles at the atomic level that have an opposite charge and spin to normal matter. Mixing matter and anti-matter particles can cause an explosion of energy, this reaction is the basis for the main Star Trek power source (e.g. the warp reactor), and therefore the key to producing the vast energy required for warp flight.
This same principle is used in photon and quantum torpedoes, but the energy is an uncontrolled release, that causes an explosion.
The reason for photons appearing to be energy is a "cheat", in actuality they, and probably even phaser beams, would be invisible to the naked eye. But, just like sound and explosions in space, they are used as the audience expects to see something.
Due to the animation effects, it was assumed by most that photons were
an energy weapon until we saw the physical torpedo casing in TWOK.