Dividing by $x$ is permissible, but this reduces the equation into two cases where $x$ may or may not be $0$.
Let's go with a basic, almost trivial, example:
$$x^2 + x = x^3 - x^2$$
Now, at a glance, we can divide this by $x$, and get
$$x + 1 = x^2 - x$$
However, the caveats abound:
- Yes, if $x=0$, we can't divide by it. We treat this case separately.
- This is especially pertinent since $x=0$ is clearly a solution of the original.
So really we have that
$$x^2 + x = x^3 - x^2 \implies \begin{cases}
x^2 + x = x^3 - x^2, & \text{if } x=0 \text{ (we'll see what happens here)} \\
x+1 = x^2 - x, & \text{if } x \ne 0\end{cases}$$
Well, the second case can be solved as usual via whatever means you prefer, e.g. quadratic formula after rearranging. This will give you some set of solutions (namely, $x = 1 \pm \sqrt{2}$).
The first equation is more simple: if $x=0$, the equation reduces to the true statement $0=0$. We conclude that $x=0$ is a solution. (If it resulted in something false, like $1=0$, then it would not be a solution.)
So the solution set of the original equation is the combination of both solution sets: $0, 1 + \sqrt 2, 1 - \sqrt 2$.
In your case, you divided by $x$.
If $x=0$, then you get something undefined in just $x/x$. BUT if you plug $x=0$ into the original equation you have, you get $0=0$: $0$ is thus a solution.
If $x \ne 0$, it becomes $1$. And then your equation simplifies and you can find some nonzero solutions.