Why chocolate is toxic: the short explanation
Chocolate contains theobromine and caffeine, compounds dogs metabolise far more slowly than humans do. In people, theobromine clears the body in a couple of hours; in dogs it can take considerably longer, which lets it build up to dangerous levels.
Darker chocolate and cocoa powder contain much more theobromine per gram than milk chocolate, which is why a small amount of dark chocolate or baking cocoa can be more dangerous than a similar amount of milk chocolate — size of dog and amount eaten both matter, which is exactly the information your vet will ask for.
Baking chocolate and cocoa powder are the most concentrated everyday forms, which makes baking days worth extra vigilance — a dropped square of baker's chocolate is a bigger risk, gram for gram, than the same weight of milk chocolate from a family bar. If in doubt about how much your dog has eaten, treat it as an emergency and call your vet rather than waiting to see if symptoms appear.