It follows from the expression for the reaction free energy. Consider, for example, the equilibrium A <--> B, where both are ideal gases. Then, the reaction free energy change, defined by
[tex]\Delta G(reac) = \left( \frac{\partial G} {\partial x} \right) _{p,T}[/tex]
where x is the reaction co-ordinate, is clearly equal to difference in chemical potentials of A and B (follows directly from definition of the Gibb's Free Energy). Then, the reason for the particular form of the equilibrium constant is seen to come from the variation of the chemical potential with p,T.
[tex]\mu_ i = \mu_ i^0 + RT~ ln~p_i ~ \implies \Delta G (reac) = \mu _B - \mu _A = \Delta G^0(reac) +RT ~ln(p_B/p_A)[/tex]
At equilibrium, [tex]\Delta G(reac) = 0[/tex]
Plug this in above, and you have,
[tex]\Delta G^0(reac) = -RT ~ ln(p_B/p_A)_{equil}[/tex]
This is the motivation to define [itex]K = (p_B/p_A)_{equil}[/itex], for this particular system. The definition can be generalized to solutions and to systems with more components.
In a more simplistic argument, one might say that the above definition provides, by means of comparing the ionic product with the equilibrium constant, a direct means of relating to le Chatelier's principle. In other words, it preserves the sanctity of forward and backward reactions, and hence, provides a simple relationship between the equilibrium constant and the forward and reverse rate constants, through the definition of equilibrium as experiencing equal forward and reverse rates.