A line in $\mathbb{R}^2$ is given by an equation of the form
$$\tag{1}\xi x+\eta y+\zeta=0,$$
where either $\xi$ and/or $\eta$ are nonzero.
This, together with equations
$$
\xi a_1+\eta b_1+\zeta=0, \quad \xi a_2+\eta b_2+\zeta=0,
$$
gives a (homogeneous) system of three equations for three unknowns $\xi$, $\eta$, and $\zeta$ in the matrix form
$$\tag{2}
M(x,y)\,c:=\pmatrix{x&y&1\\a_1&b_1&1\\a_2&b_2&1}
\pmatrix{\xi\\\eta\\\zeta}=0.
$$
A point $(x,y)$ hence lies on a line containing points $(a_1,b_1)$ and $(a_2,b_2)$ if and only if (2) has a nontrivial solution, that is, iff $M(x,y)$ is singular iff $\det M(x,y)=0$.
Remark It is easy to see that a singularity of $M(x,y)$ implies we have a well defined line with $\xi\neq 0$ and/or $\eta\neq 0$. A solution with $\xi=\eta=0$ would necessarily be trivial.
Remark For a unique line, $\xi$, $\eta$, and $\zeta$ are defined up to a constant nonzero multiple. The equation (2) says that the vector of these coefficients is an eigenvector of $M(x,y)$ associated with the zero eigenvalue. So for a unique line, we need that the corresponding eigenvector space is one-dimensional. But since $(a_1,b_1)\neq(a_2,b_2)$, one can check that the rank of $M(x,y)$ is at least two (and equal to two if $M(x,y)$ is singular). Hence the singular $M(x,y)$ has a one-dimensional and the line (1) is unique.