Gravity, a prevalent force in mechanics, is responsible for the attraction between masses and plays a pivotal role in determining the weight of objects.