The maximum pinning force of a two-dimensional vortex lattice in a random potential is calculated. A connection is established between this threshold pinning force and the potential energy discontinuities due to elastic and plastic instabilities of the vortex lattice. Inspired by recent computer simulations, we assume that the fluctuations in the commensurability between the random potential and the vortex potential breaks the vortex system up into a set of flowing channels in between trapped regions. Two instability mechanisms and their contribution to the threshold force are discussed within this channel-flow picture. We find that three different regimes exist depending on, w, the width of the channels;w=∞, a0<w<∞, and finally w=a0, where a0 is the vortex lattice spacing. Weak pinning superconductors can pass through all three regimes as the reduced magnetic field is varied from 0 to 1, whereas strong pinning compounds can remain in the saturated region (w=a0) for all values of the field. We compare the expression for the threshold force with experimental results for both strong and weak pinning samples. A satisfactory qualitative agreement is obtained between theory and experiment.