The masses affect the magnitude of impulse in a collision.
Consider two bodies of mass $m_1$ and $m_2$ about to collide with relative velocity $v_{\rm rel} = v_2 - v_1$.
Considering the coefficient of restitution $\epsilon$, which is an empirical value is used to find the relative velocity after the collision
$$v_{\rm rel}' = - \epsilon\; v_{\rm rel} \tag{1}$$
the required impulse $J$ to follow this rule is simply
$$ J = (1+\epsilon) m_{\star} v_{\rm rel} \tag{2}$$
where $m_{\star}$ is the reduced mass of the system and it is defined as $$ m_\star = \frac{1}{ \tfrac{1}{m_1} + \tfrac{1}{m_2} }$$
The final velocities are found by the application of an equal and opposite impulse $J$ to each body
$$ \begin{aligned}
v_1' &= v_1 + \tfrac{1}{m_1} J &
v_2' &= v_2 - \tfrac{1}{m_2} J
\end{aligned} \tag{3}$$
If you plug (2) into (3) you will find that $J$ solves the equation (1) exactly.
In summary, the coefficient of restitution $\epsilon$ is a simplification that is empirically derived from experiments relatives the relative motion before and the collision. Given a COR value and the conditions of a collision the impulse magnitude) is estimated from (2).
Additionally, if the collision is estimated to occur over a finite time $\Delta t>0$ then the impulse $J$ can give us an estimate of the peak and average contact force
$$ \begin{aligned} F_{\rm ave} & = \frac{J}{\Delta t} & F_{\rm max} & = \frac{\pi J}{2 \Delta t} \end{aligned} $$
This is derived from the estimated force-over-time curve to be that of half a cosine.