I always presumed it was holding a carrot on a stick in front of a donkey so that the donkey would be walking forwards towards the carrot. If you're sat on the donkeys back holding the carrot on the stick then the carrot will always be just in front of the donkey, he'll keep on walking to try to reach it and you'll get where you're going!