Try imangining you compressing a spring. If you pressed with 10 N, then the spring would try to oppose it(You can feel it trying). If you pressed it until it was half as wide as initially, and stood still there, then the acceleration of the spring equals zero(a=0). Then Newtons first law of motion states:
[itex]\sum F = 0[/itex]
The two forces are in opposite directions(you pressing and the spring pressing against)
[itex]Fhook-Fpress = 0 \,\Leftrightarrow \\ kx -10N = 0\\<br />
kx = 10N[/itex]