This is due to the way the equilibrium constant is defined.
A chemical equilibrium is a stable state at some point in the reaction (characterized by the extent of reaction $\xi$). Because it is a stable state the free enthalpy $G$ has to have a local minimum at exactly that place.
Therefore we can say
$$
\left( \frac{\partial G}{\partial \xi} \right)_{p,T} = 0
$$
On the other hand the following equation applies:
$$
\Delta_rG_m = \left( \frac{\partial G}{\partial \xi} \right)_{p,T} = \sum_i \mu_i \cdot \nu_i
$$
With the free, molar reaction enthalpy $\Delta_rG_m$, the chemical potential of the component $i$ $\mu_i$ and it's reaction-coefficient $\nu_i$ (To understand this consider this general reaction equation: $\ce{\nu_1A + \nu_2 B <=> \nu_3 C}$ - note that the coefficients for the educts are negative by definition).
Therefore we can say that the following equation applies for the equilibrium state:
$$
\Delta_rG_m = 0
$$
we can rewrite above formula with the aid of the activity-dependency (basically a concentration-dependency) of the chemical potential ($\mu_i = \mu_i^* - RT\cdot\ln(a_i)$):
$$
\begin{split}
\Delta_rG_m &= \sum_i \mu_i \cdot \nu_i\\
&= \sum_i \nu_i\mu_i^* - RT \cdot \sum_i \nu_i\ln(a_i)
\end{split}
$$
Because $a \cdot \ln(b) = \ln(b^a)$ this is the same as
$$
\Delta_rG_m = \sum_i \nu_i\mu_i^* - RT \cdot \sum_i \ln(a_i^{\nu_i})
$$
Now we define the standard, free, reaction enthalpy $\Delta_rG_m^* = \sum_i \nu_i\mu_i^*$ and because we found out (in the beginning) that for the equilibrium state $\Delta_rG_m$ has to be zero we can write:
$$
\Delta_rG_m^* = -RT \cdot \sum_i \ln(a_i^{\nu_i})
$$
Because $ \ln(a) + \ln(b) = \ln(a\cdot b)$ we can rewrite this as
$$
\Delta_rG_m^* = -RT \cdot \ln\left(\prod_ia_i^{\nu_i}\right)
$$
The last step is now to define the equilibrium constant $K$ as
$$
K = \prod_ia_i^{\nu_i}
$$
And that is how the coefficients in the recation equation end up in the exponent when calculating the equilibrium constant.