I am learning precalculus, and I understand how to obtain first two solutions, but I don't understand where did last four solutions came from:
All values of $\theta$ in the interval $[0,2\pi]$ that satisfy $\sin 3\theta=1/2$ are $$\theta = \frac{\pi}{18}, \frac{5\pi}{18}, \frac{13\pi}{18}, \frac{17\pi}{18}, \frac{25\pi}{18}, \frac{29\pi}{18}$$

Write out $3\theta$: $\frac{\pi}{6}$, $\frac{5\pi}{6}$, $\frac{13\pi}{6}$, $\frac{17\pi}{6}$, $\frac{25\pi}{6}$, $\frac{29\pi}{6}$. Now subtract $\frac{\pi}{6}$ from $\frac{13\pi}{6}$, and you get $\frac{12\pi}{6}=2\pi$. The sine function is periodic, with this period. You get all the other by adding $2\pi$ or $4\pi$ to the first solutions.
Maybe a more obvious way of thinking about the problem is to say $\alpha=3\theta$, and find all solutions of $\sin\alpha=\frac 12$ in the interval $[0,6\pi]$.