Well, I can't tell you about the complicated inner-workings, but I know that if you take one apart, you can get a pile of magnesium powder that lights up and is fun :D.
Basically, when a flashbang goes off, it makes an incredibly bright falsh, and an incredibly loud bang (Flash+Bang, get it?)...