Chocolate contains compounds known as methylxanthines, primarily theobromine and caffeine, which are responsible for its potential toxicity. Theobromine is found in higher concentrations in chocolate and is the primary concern regarding toxicity. While humans can tolerate these compounds in moderate amounts, certain animals, like dogs and cats, metabolize them much more slowly, leading to toxic effects.