When you pull on a rope, assuming the rope is massless (i.e., is of
negligible mass) and doesn't stretch or contract, the tension is the
force transmitted by the rope. If you imagine any little piece of the
rope, by Newton's third law, if it pulls on its righthand neighbor
with force
, that neighbor piece is pulling on it with a force
equal in magnitude and opposite in direction. So for a piece anywhere
in the rope, you can think of it as exerting and feeling a force
in either direction.
From a practical point of view for doing problems (and which is also a reasonable approximation for real life), when you have a massless rope, you can assume the tension is equal in magnitude everywhere in the rope.