

When we rub two objects with each other, then which object will lose electron, depends on a factor, which is called the work function.
Work function is the minimum energy required to remove an electron from the surface of an object.
So, in hair-comb experiment, the work function of hair is less than the comb, so hair loses electrons.
