Pick every pair of points. For each pair, count how many other points lie on that line.
There are pairs. For each pair, checking all other points is . Total: .
With , that's million operations. Too slow.
You need a way to avoid rechecking the same line from different pairs.