Ball tampering is an action in which a fielder illegally alters the condition of the ball. The primary motivation of ball tampering is to interfere with the aerodynamics of the ball.
Why rubbing the ball not considered ball tampering because of Law 42, section 3
It says:
(a) Any fielder may
(i) polish the ball provided that no artificial substance is used and that such polishing wastes no time.
(ii) remove mud from the ball under the supervision of the umpire.
(iii) dry a wet ball on a piece of cloth.
(b) It is unfair for anyone to rub the ball on the ground for any reason, to interfere with any of the seams or the surface of the ball, to use any implement, or to take any other action whatsoever which is likely to alter the condition of the ball, except as permitted in (a) above.
So polishing the ball on clothing, or using sweat, is perfectly ok. Other types of tampering are not permitted.