When a string or cord is attached to a body and pulled taut, the cord pulls on the body with a force vector T directed away from the body and along the cord Fig. The force is often called a tension force because the cord is said to be in a state of tension (or to be under tension), which means that it is being pulled taut. The tension in the cord is the magnitude T of the force on the body.
If the cord (string) is mass less, the tension in cord everywhere *** the same.The cord then exists only as a connection between two bodies.
If the cord (string) is massive, the tension in it varies point to point.