Human hair also does the same thing. Blondes and people with white/gray hair can experience yellowing or brassy colored hair as well. Hair with light or no pigment tends to be more porous than hair with darker pigments, and porous hair tends to absorb things found in the environment. For blonde and gray/white-haired humans that usually tends to be dirt, scalp oils, minerals from water (think showers, pools, etc) air pollutants, and smoke.
Horses tails are probably picking up more stains from natural water, urine, dirt, maybe oils the skin on their tails produce, and also air pollutants to some degree. Their hair is also usually washed significantly less frequently than human hair and I imagine the coarseness of the hair probably also helps it hold onto stains better.
Blue or purple shampoo usually helps get rid of the yellowing, although if you’re not showing most people will simply deal with having a yellow tail on a regular basis as too much washing can turn hair brittle and dry.