They vary a lot. Usually they need a little bit of compressibility to protect the hydraulic damper, and or a blow off valve. The damper (which is what holds the lockout) is generally not designed to withstand the forces of a hard hit while locked out. Also, for many riders having a useful climbing mode that reduces pedal bob while still allowing helpful suspension movement to maintain ground traction is more valuable than a rock hard lockout, and so many trail oriented forks have an intentionally softer climb mode. If the lockout becomes softer than it originally was that's a sign that the fork's damper requires service.