The Lock and Key analogy is a theory that was first postulated by in 1894 by Emil Fischer. In this theory, the lock is the enzyme and the key is the substrate. The correct sized key (substrate) will fit in the key hole/active site of the enzyme (lock).
For example enzyme Amylase, amylase is the hereby the enzyme whereas starch forms the substrate. The molecule of starch will form the required shape and fit into the active site of the Amylase to undergo breakdown to form maltose