Enzymes can bind substrates and release them in equilibrium, and every substrate turns into product via a transition state.
This transition state binds to the active site extremely tightly (you never get any dissociation of transition-state substrates from an enzyme)
So, a good competitive inhibitor will have similar structure to the transition state of the substrate, and therefore will bind REALLY well to the enzyme