If a ball is thrown up, after reaching a particular height it will come back due to:
Gravity
Friction
Normal
Due to the gravitational force of Earth, every object is attracted towards the earth. Therefore the ball will be attracted towards the centre of the earth, so it will come back. If there was no gravity on Earth then the ball if thrown up, will never come back.