The carrot is tied to the stick using twine so it dangles enticingly in front of the donkey.
Personally, I think "carrot on a stick" and "carrot or stick" are perfectly compatible. First, you dangle the carrot on the stick in front of the donkey. If the donkey does what you want, you eventually give it the carrot. If the donkey doesn't do what you want, you untie the carrot and beat the donkey with the stick.