Hang a spring from a hook and add 100 g masses one at a time. Each mass weighs about 0.98 N, and each one stretches the spring by the same extra 2.0 cm: 2 cm, then 4 cm, then 6 cm. Force and stretch rise in step, so their ratio stays fixed: k=0.020 m0.98 N=49 N/m. That constant is the spring's stiffness. A stiffer spring has a larger k and stretches less under the same load.
The force always points back toward the natural length. Pull the end down and the spring pulls up; push it in and it pushes out. In F=−kx the minus sign is exactly that rule: force and displacement have opposite signs. Measure x from the relaxed length. A spring that is 30 cm long at rest and 36 cm long when stretched has x=6 cm, not 36 cm.
Contrast this with a rope. A taut rope's tension is not set by how far it stretches; the rope pulls as hard as it must to hold or accelerate its load, while stretching almost nothing. A spring's force is set by its stretch alone. Also, a spring pulled past its elastic limit stops following the rule: the force is no longer proportional to x, and the spring stays longer when released. If a problem gives a stiffness and a stretch, it is a spring problem; if it gives a load hanging from a cord, it is tension.
Think of it like this. A spring is a fair bargainer: for every extra centimetre you take from its natural length, it pushes back with the same extra force, always toward where it started. Pull 3 cm and you feel three times the pull of 1 cm. The bargain holds only within the elastic limit; stretch too far and the spring is permanently changed.
Core idea. A spring pushes or pulls back toward its natural length with a force proportional to how far it has been stretched or squeezed, F=−kx, as long as it stays within its elastic limit.