Suppose that $r = 0.a_0a_1...a_n\overline{b_0b_1...b_m}$ (remove the integral part of $r$, that keeps it as a rational/irrational), where $a_i$ is the fixed part and $b_i$ is the recurring part.
Note that:
$$
r\cdot10^{n} = a_0\ldots a_n + 0.\overline{b_0\ldots b_m}
$$
$$
r\cdot10^{n+m} = a_0\ldots a_n b_0 \ldots b_m + 0.\overline{b_0\ldots b_m}
$$
Subtract:
$$
r(10^{m+n}-10^n) = a_0\ldots a_n b_0 \ldots b_m - a_0\ldots a_n
$$
Which implies:
$$
r = \frac{a_0\ldots a_n b_0 \ldots b_m - a_0\ldots a_n }{10^{m+n}-10^n}
$$
So $r$ is rational.
A rational number must have a repeating/terminating expansion. To see this, first we remove the integer part and assume that $r = \frac{p}{q}$, where $p < q$. Next, we note that by multiplying the numerator by $10^n$ for sufficiently large $n$, we can assume that $\frac{p(10^n)}{q}$ in it's simplest form, is of the form $\frac{s}{t}$ where $\gcd(10,t) = 1$. Once, this happens, we have Euler's theorem: $t | (10^{\phi(t)} - 1)$ where $\phi(t)$ is the Euler totient function.
So what we do is:
$$
\frac{s}{t} = \frac{s(10^{\phi(t)}-1) + s}{t10^{\phi(t)}} = \frac{s}{10^{\phi(t)}}\frac{(10^{\phi(t)}-1)}{t} + \frac{1}{10^{\phi(t)}}\frac{s}{t}
$$
Now you see where the recurrence comes from. Apply the same trick on the second $\frac{s}{t}$:
$$
\frac{s}{t} = \frac{s}{10^{\phi(t)}}\frac{(10^{\phi(t)}-1)}{t} + \frac{1}{10^{\phi(t)}}\bigg(\frac{s}{10^{\phi(t)}}\frac{(10^{\phi(t)}-1)}{t} + \frac{1}{10^{\phi(t)}}\frac{s}{t}\bigg)
$$
You can see where the repeating decimal comes from. The final answer you will get is:
$$
\frac{s}{t} = \frac{s}{t} (10^{\phi(t)}-1) \sum_{i=0}^\infty \bigg(\frac{1}{10^{i\phi(t)}}\bigg)
$$
Thus, the part $\frac{s10^{\phi(t)}}t$ keeps repeating in the fraction, while the $10^n$ in the starting shifts the value by a slight bit. Hence the decimal recurs, because of this repeating part. If there's no repeating part, then because $n$ is finite we have a terminating decimal.
For example, let us take $\frac{4}{3}$. We subtract $1$ to give a proper fraction $\frac{1}{3}$. According to our hypothesis, $10^{3-1}-1 = 99$ is divisible by $3$, and the quotient is $33$. Hence, the answer is:
$$
\frac{1}{3} = 0.\overline{33} \implies \frac{4}{3} = 1.\overline{33}
$$
To take a slightly more non-trivial example, let us take $\frac{19}{12}$.
Here, we first subtract $1$ and make the fraction proper, to $\frac{7}{12}$. Then, we multiply by $10^2=100$ on the top, so that we get a new fraction $\frac{175}{3}$. We again remove the part $58$ to leave $\frac{1}{3}$.
Now, $\frac{1}{3} = 0.\overline{33}$, so $\frac{175}{3} = 58.\overline{33}$, and $\frac{7}{12} = 0.58\overline{33}$, and $\frac{19}{12} = 1.58\overline{33}$.
I hope this procedure explains the reverse as well.