The current theory I've been reading is that the chemical melamine was added deliberately in order to spoof quality tests into indicating the protein content was higher than it was. Protein contains nitrogen, starches and carbs don't, so the test for protein content is usually just a test for nitrogen content
What I want to know is what kind of idiot thought they could get away with this for long? Pet Food manufacturers should be suing their importer for this (if they were not complicit) and pet owners who have sunk thousands into saving their sick dogs and cats should sue the importer as well... and I am not a person who believes in suing for anything.
Of all the possible chemicals that could have been added accidentally, melamine just happens to be one that is 2/3 nitrogen by weight.