Affection is the horse's "affection for its owner" in Horse Reality. The affection, represented as a pink bar, is located on the horse's profile, on the right side of the Training tab.
Horses can gain and lose affection in various ways. Overnight the horse's affection will decrease by 3%. By caretaking and training, the horse's affection will increase. Every time a horse gets trained or put in the roundpen, regardless further details such as duration, it will receive +3% affection. When caring for your horse via the buttons on the Summary tab, feeding it a treat will add +1% affection as well.
At the Equistore, under the "Food" section, you can buy two items that give affection boosts: Apples and Horse Treats. You can feed these to your horses via your inventory. An apple fills the hunger bar by +5% and adds +3% affection. A portion of horse treats fills the hunger bar by +1% and gives a +5% affection boost. You can only feed each horse one treat item per day. To feed an apple or horse treats via your inventory, the horse must not have received any treat yet since the last rollover. This means the "Give treat" button on the Summary tab must still be clickable.