I understand that $ \frac {6 \text{ chocolates}}{2 \text{ friends}} = 3 \text { chocolates per friend}$, but what are the units involved if I rearrange this as follows?
$$6 \times \frac 1 2 = 3$$
$6$ still seems to be chocolates, $3$ seems to be $\frac{\text{chocolates}}{\text{friends}}$, but $\frac 1 2$ doesn't seem to be friends.
In the second expression the units of $1/2$ are $\text{friends}^{-1}$.
In general $$ \frac{1}{x \text{ units}} = \frac{1}{x} \text{ units}^{-1}. $$ The $1$ in that expression is dimensionless.