It is only poisonous to certain animals. The ones it “wants” to disperse the fruit wouldn’t be affected by the poison.
As an imaginary example, let’s say there’s a tree that has seeds. These seeds would grow great in dung, but if it was chewed it would break up and nothing would grow. This fruit might be poisonous to cows and goats, which chew food, but safe for birds which seeds food whole.
Latest Answers