The horse learns by association and his choices that he makes are fully related with the attractive or aversive associations that he makes with his environment.
For example: the wheelbarrow that arrives in the stable becomes very attractive because it announces the arrival of the pellets; The obstacle can become very aversive if someone has put too much pressure when approaching this wooden bar ... It all depends on what your horse lives at the moment T.
In education we often use these associations.
For example: I close my legs, which is uncomfortable for the horse, and I remove my legs when the horse has responded.
Or: to go over a tarpaulin, I make it uncomfortable outside the tarpaulin and comfortable on the tarpaulin (ie: working outside the tarpaulin and stopping work on the tarpaulin)
Be careful not to confuse discomfort and terrorization! Depending on the sensitivity of your horse the discomfort may be something very light.