What does Hooke's law have to do with molecular forces?

In The Feynman Lectures, in the chapter Characteristics of Force, In the section entitled Molecular forces, Feynman talks about the molecular forces, and then he states afterwards:

If the molecules are pushed only a very small distance closer, or pulled only a very small distance farther than d, the corresponding distance along the curve of Fig. 12–2 is also very small, and can then be approximated by a straight line. Therefore, in many circumstances, if the displacement is not too great the force is proportional to the displacement. This principle is known as Hooke’s law,...

I understand that at $x=d$ and the region nearby, this function can be modeled as $F=-kx$. Although I know that Hooke's law for the springs has exactly the same form, But why Feynman brings up Hooke's law when discussing molecular forces? Has these two forces something to do with each other? Is one the result of another? or he just saw an opportunity to mention Hooke's law, since The molecular force function at $x=d$ has the same mathematical form of Hooke's law?

As the picture already shows this can only be considered an approximation for the force in a interval $x\in (d-\epsilon, d+\epsilon)$ for small $\epsilon$. Already the constant $k$ in your expression $F=-kx$ will be different from the constant $k$ in the picture in $F=\frac{k}{r^7}$ - basically, in Hooke's law you will have additional dependencies on $d$ and the exponent $7$. So, it would be better to call $k$ in Hooke's law differently here, e.g. $\tilde k$. Hooke's law then is a first order approximation at $d$ - think Taylor expanding the force around $d$.

Of course, this can be done in a lot of different to very different scenarios. Therefore, both the linear force of Hooke's law and the corresponding quadratic energy are ubiquitous in physics. If you are interested more in the energy than the force, you'll see much more often the term "harmonic oscillator", especially once you go to quantum mechanics where talking about forces turns out to be more cumbersome than about energies.

So, to sum it up, as Alex' answer put it: It's mostly to be considered a mnemonic, as you've most likely seen Hooke's law for springs before anything else of this kind.

Small addendum: I'm a bit sceptical about that $F=\frac{k}{r^7}$ bit... That will/might hold for negative $k$ and for the asymptotic bit for $r\to \infty$, but lacks local minima. So already that is an approximation to the function shown in the graph. It's a bit asking for confusion to place it there in the first place.

Feynman may have been thinking that the same equations have the same solutions. That is, since the molecule obeys $F=-kx$ for small displacements, we can bring along all our previous solutions and intuitions we obtained in solving the problem of a mass on a spring. For example, the oscillation frequency is $\omega=k/m$.

Feynman is wonderful because he draws visual analogies so well. Like when he refers to theoretical physics as a chess game in the dark. In this case he is helping you to remember the way molecules behave by associating them with springs.

The first two terms of Taylor series of a function is; f(x)=f(a)+f'(a)(x-a) around the point a, or slightly displaced from a. If displacement is measured from a instead, we get the form f(x)=k x. The k=f'(x) (at x=a), can of course be positive or negative. Only if it is negative we get a restoring force like that of a spring, i.e Hook's law. A restoring force around the equilibrium point and a mass 'm' is all that you need to produce vibrations, wherein the energy transforms periodically between potential and kinetic with a period determined by the square root of k/m.

This is true in the case of the inverse square force 1/r^2, with the derivative being negative. But other force dependence might give a positive sign. In this case the structure is not stable as the force increases with displacement, i.e not a restoring force. Thus one can also say that for a stable group of particles, the force-displacement of any particle a small distance should obey Hook's law or the space-spring law as is called in QM.

It is interesting to also observe that the space-spring force is the real reason behind the idea of wave-particle duality in QM, as this resulted in a harmonic force field in a region of confinement, and effectively a spatial filter guiding particle's paths to form the interference and fringe patterns observed experimentally, as in the case of an electron through a crystal for example.