The principle behind long division is repeated subtraction. If we want to divide a number $p$ by a number $q$, what we are trying to do is subtract as large a multiple of $q$ from $p$ as we can, until the difference is $0$ (if possible).
Let's take a nastier example for illustration. Suppose we wish to divide $4101$ by $12$. We want to subtract multiples of $12$ from $4101$. We can start by subtracting multiples of $12 \times 10^2 = 1200$, since this is a very simple, large multiple of $12$. We have
\begin{align*}
4101 - \color{red}{3} \times 12 \times 10^2 &= 4101 - 3600 = 501 \ge 0 \\
4101 - \color{red}{4} \times 12 \times 10^2 &= 4101 - 4800 = -699 < 0.
\end{align*}
So, we can only take $\color{red}{3}$ lots of $12 \times 10^2$ from $4101$ before we've taken too much. When we do, we are left with $501$. We know we cannot take even $1$ lot of $12 \times 10^2$, so we try one order of magnitude less: $12 \times 10^1$. We have
\begin{align*}
501 - \color{green}{4} \times 12 \times 10^1 &= 501 - 480 = 21 \ge 0 \\
501 - \color{green}{5} \times 12 \times 10^1 &= 501 - 600 = -99 < 0.
\end{align*}
We can only take $\color{green}{4}$ lots of $12 \times 10^1$ from $501$. Note that, in total we have
$$4101 - \color{red}{3} \times 12 \times 10^2 - \color{green}{4} \times 12 \times 10^1 = 4101 - \color{red}{3}\color{green}{4}0 \times 12 = 21 \ge 0.$$
From $21$, we can take a single multiple of $12 \times 10^0 = 12$, as
\begin{align*}
21 - \color{purple}{1} \times 12 \times 10^0 &= 21 - 12 = 9 \ge 0 \\
21 - \color{purple}{2} \times 12 \times 10^0 &= 21 - 24 = -3 < 0.
\end{align*}
In total,
$$4101 - \color{red}{3}\color{green}{4}\color{purple}{1} \times 12 = 9 \ge 0.$$
From the remaining $9$, $12$ cannot be subtracted any positive integer number of times without becoming negative. But, this doesn't mean we have to stop. Maybe no more whole amounts of $12$ will go into $9$, but we can try fractional parts of $12$. Again, all we do is go down an order of magnitude:
\begin{align*}
9 - \color{orange}{7} \times 12 \times 10^{-1} &= 9 - 8.4 = 0.6 \ge 0 \\
9 - \color{orange}{8} \times 12 \times 10^{-1} &= 9 - 9.6 = -0.6 < 0.
\end{align*}
So,
$$4101 - \color{red}{3}\color{green}{4}\color{purple}{1}.\color{orange}{7} \times 12 = 0.6 \ge 0.$$
Once more,
\begin{align*}
0.6 - \color{blue}{5} \times 12 \times 10^{-2} &= 0.6 - 0.6 = 0 \ge 0 \\
0.6 - \color{blue}{6} \times 12 \times 10^{-2} &= 0.6 - 0.72 = -0.12 < 0.
\end{align*}
That is,
$$4101 - \color{red}{3}\color{green}{4}\color{purple}{1}.\color{orange}{7}\color{blue}{5} \times 12 = 0 \implies \frac{4101}{12} = \color{red}{3}\color{green}{4}\color{purple}{1}.\color{orange}{7}\color{blue}{5}.$$
I'm hoping this answer conveys a better understanding of the logic behind here. The decimal point in question is being introduced around where we subtract two numbers with a different number of decimal places. For example, when compute
$$9 - 8.4 = 0.6 \ge 0.$$