Why is enzyme activity similar to, but not exactly like, a "lock" and "key"?
Enzyme catalysis is similar but not exactly modeled by a lock and key mechanism for energetic reasons.
As Vivi explained, enzyme specificity - that is, the enzyme's ability to bind only the correct substrates - comes from having a shape that is nearly perfect for one particular type of molecule. In that sense, the substrate fitting into the enzyme is like a key fitting into a lock.
The analogy isn't perfect because the enzyme actually has the highest binding affinity - that is, the best fit - not for the substrate, but for the closely related intermediate transition state the substrate takes when it is half way through its reaction.