Chocolate toxicity (poisoning) is caused by excessive intake of
the methylxanthine alkaloids in chocolate, coffee, tea and caffeinated sodas.
The major components
methylxanthine alkaloids and theobromine in regular chocolate is digested & excreted by humans in as little as 3 hours but the same compounds when ingested by dogs stays inside them for 18 hours.
The root of the problem is that chocolate contains various chemicals which are called
methylxanthine alkaloids (some types have more of these chemicals than others).