All objects have some gravitational pull of their own.
The apples would have a pull on each other, but they have such a small mass in comparison to the earth that they do not move toward each other.
On the other hand, the earth's mass is so huge that it pulls everything towards it--gravity! The force of one apple being pulled by the earth is significantly greater than the force of the apples acting on each other.