Melamine, the molecule shown below, has the formula C3H6N6, and the chemical name 1,3,5-triazine-2,4,6-triamine. It is an aromatic molecule; it possesses a six atom ring of carbon and nitrogen atoms with delocalized bonding increasing the stability of the ring.
Melamine and formaldehyde are the main components of the plastic known as melamine resin. The polymerization occurs when melamine and formaldehyde are baked together. Melamine resin is the plastic coating of particle board based furniture.
As you can see from the formula, this molecule contains many nitrogen atoms. This gives rise to two additional applications of melamine, the first of which is generally beneficial, and the second potentially lethal.
The first application is as a flame retardant. Melamine is added to many plastics and other materials. When the melamine molecule decomposes, it releases nitrogen. As nitrogen is a relatively inert molecule, the nitrogen that is released tends to smother flames caused by the oxidation of the plastic. Hence melamine serves the purpose of an emergency supply of an inert gas to be called upon as the polymer is beginning to thermally decompose.
The second application is as a food adulterant added to increase the apparent nitrogen content of various food sources. This illegal application makes use of the fact that melamine is a low cost source of nitrogen, and that many tests for protein content actually simply measure the nitrogen content of the food. The resulting food adulteration has had terrible consequences as melamine is a toxic molecule. Many humans and animals have suffered and even died as a result of consuming melamine tainted foods.
There are a variety of solutions to the melamine in food scandals. More sophisticated tests for protein content could be used; specific adulterants like melamine could be tested for, penalties for selling adulterated foods increased, or chief executive officers given a pivotal role in proving the quality of their products by using those products themselves!
Melamine itself is just a collection of nitrogen, carbon, and hydrogen atoms. Its application in plastics stem from its ability to make three bonds to other monomers and its ability to quench fires with its nitrogen atoms. Its deleterious applications owe their origin to the willingness of criminals to exploit a molecule's properties in order to trick their customers and the public.