In Introduction to Mechanics by Kleppner and Kolenkow they talk about the tension force of a string and its microscopic origins. They explain how applying a force on a string slightly increases the distances between the molecules and makes them attract each other, in a way that balances the applied force. In their explanation, they present the following graph, which qualitatively describes the force between two molecules as a function of their distance.
For $r<r_0$ it is repulsive, then attractive for $r>r_0$; moreover it reaches a maximum and then decays to $0$.
I'm interested in an explanation for this behavior. Which forces govern it? Why is the graph shaped as it is?