A competitive inhibitor has a similar shape to the substrate which an enzyme catalyses. Because of this they block the active site of the enzyme (the site on the enzyme that is complementary in shape to a specific substrate), preventing the substrate binding to the active site of the enzyme so the enzyme can't carry out it's function (thus it is inhibited)
A non-competitive inhibitor has a similar shape to the allosteric site of an enzyme - another binding site other than the active site elsewhere on the enzyme. When the non-competitive inhibitor binds it changes the tertiary structure of the enzyme. This means the active site is no longer complementary to the shape of the substrate it catalyses - thus the enzyme is inhibited