There is a small pellet of impact-sensitive material in the primer cup, at least today it contains lead styphnate plus other ingredients. There is a small anvil over the pellet. When struck by the firing pin, the pellet is mashed between the cup and the anvil, setting it off. It then shoots hot sparks through a flash hole in the case, igniting the propellant. That is pretty much it. There is a ton of primer technology information on the internet, just look for it.
Be aware that lead styphnate (there are two different types of lead styphnate) is only one of a number of ingredients in the primer mixture, but it is the most important as it is the ingredient which is impact-sensitive. There are several other impact-sensitive materials which have been used (and are being used) in primer mixtures instead of lead styphnate. One is a compound called diazodinitrophenol (DDNP) which is used in lead-free primers, and was used in some primer compositions as far back as WWII. Federal has also recently come out with a metal-metal oxide impact-sensitive primer material which reacts much like Thermite. For many years prior to the mid-1940s military ammunition primers used an impact-sensitive chlorate composition (very similar to that used for making cap gun caps), the main problem with it being that it caused bore corrosion, whereas lead styphnate and DDNP do not. Very early (19th century) percussion caps and cartridge primers used mercury fulminate as the impact-sensitive component. Its main (but not its only) problem was that it had a short shelf life, especially in warm climates. Chlorate and lead styphnate primers have very long shelf lives.