The law of mass action (Guldberg and Waage) applies to the dissociation equilibrium of weak acids: $HB$ $+$ $H_2O$ $\rightleftarrows$ $ H_3O^+$ $+$ $B$ $K$ $=$ $\frac{[H_3O^+][B]}{[HB][H_2O]}$ In dilute solutions of acid, the molarity of $H_2O$ differs very little from what we have seen for pure water: $[H_2O]$ $=$ $55.5 \frac{mol}{L}$, so: $K\cdot[H_2O]$ $ =$ $\frac{[H_3O^+][B]}{[HB]}$ Under these conditions, $ K\cdot[H_2O] $ is a new constant which like $K$ is depending only on the temperature. It is called acidity constant:
$K_a$ : acidity constant of the acid-base couple $(HB,B)$: $K_a$ $=$ $\frac{[H_3O^+][B]}{[HB]}$
Consider two weak acids 1 and 2 with $K_{a1}\gt K_{a2} $: The numerator of the expression $\frac{[H_3O ^ +][B]}{[HB]}$ is greater in 1 than in 2 (or the denominator smaller), which means that in the aqueous solution 1 there will be more $H_3O^+$ and $B$ and less $HB$ than in 2, 1 is more dissociated ("stronger") than 2
$K_{a1}\gt K_{a2}$ $\Rightarrow$ $HB_1$ "stronger" (more dissociated) than $HB_2$
Example: Chloric acid $HClO_3$ with $K_a$ $=$ $10$ is a (weak!) acid but much stronger than chlorous acid $HClO_2$ with $K_a$ $=$ $10^{-2}$
In analogy to the $pH$, we define:
$pK_a$ $=$ $-logK_a$ $K_a$ $=$ $10^{-pK_a}$
Example: A weak acid $pK_a$ $ =$ $ 3.5$ has an acidity constant $K_a$ $=$ $ 10^{-3.5}$ $=$ $ 3.2\cdot 10^{-4}$
As the function $-log$ is decreasing, we obtain for two weak acids 1 and 2:
$pK_{a1}\lt pK_{a2}$ $\Rightarrow$ $HB_1$ "stronger" than $HB_2$
Example: Hydrofluoric acid $HF$ with $pK_a$ $=$ $3.17$ is a (weak!) acid, but a lot stronger than hypochlorous acid $HClO$ with $pK_a$ $=$ $7.30$