Answer to the OP's Question:
The best way to judge this divisibility by $13$ would be to use the congruence relation $$1000 \equiv -1\pmod {13}$$
Using this relation, it will be very easy to check for divisibility by $13$ for large-digited numbers (greater than $3$ digits). However, this method does not work for numbers with $1,2,3$ digited numbers. Hence for numbers with less than $4$ digits, it is better to divide and check what happens.
Justification of the Rule:
Say $N=a_0+10a_1+10^2a_2+\ldots +10^na_n$ is any number and $a_0$ is the digit in its units' place.
On deleting the last digit, the number becomes $a_1+10a_2+\ldots +10^{n-1}a_n$
And on subtracting $9$ times the deleted digit, the number becomes $a_1+10a_2+\ldots +10^{n-1}a_n-9a_0$
Then according to the given algorithm, you have to check if
$$a_1+10a_2+\ldots +10^{n-1}a_n-9a_0 \equiv 0 \pmod{13}$$
If the above holds, then it means
$$a_1+10a_2+\ldots +10^{n-1}a_n-9a_0 \equiv 0 \pmod{13}$$
Or $$10a_1+10^2a_2+\ldots +10^na_n-90a_0 \equiv 0 \pmod{13}$$
Or $$a_0+10a_1+10^2a_2+\ldots +10^na_n-91a_0 \equiv 0 \pmod{13}$$
Or $$a_0+10a_1+10^2a_2+\ldots +10^na_n \equiv 91a_0 \pmod{13}$$
And irrespective of $a_0$, $13$ divides $91$. So we get
$$a_0+10a_1+10^2a_2+\ldots +10^na_n \equiv 91a_0 \equiv 0\pmod{13}$$
that is, $$N \equiv 0\pmod{13}$$
that is, $$13|N$$