2. A bag contains 4 identical balls, marked with numbers $1, 2, 3, 4$. After shaking the bag, a ball is randomly drawn, the number is noted, and the ball is put back. The bag is then shaken again, and a ball is randomly drawn. The probability that the number on the ball drawn the second time is not less than the number on the ball drawn the first time is ( ).
(A) $\frac{1}{4}$
(B) $\frac{3}{8}$
(C) $\frac{1}{2}$
(D) $\frac{5}{8}$
2. D.

According to the problem, list all possible outcomes as shown in Table 1:
Table 1
\begin{tabular}{|c|c|c|c|c|}
\hline First & 1 & 2 & 3 & 4 \\
\hline 1 & $(1,1)$ & $(2,1)$ & $(3,1)$ & $(4,1)$ \\
\hline 2 & $(1,2)$ & $(2,2)$ & $(3,2)$ & $(4,2)$ \\
\hline 3 & $(1,3)$ & $(2,3)$ & $(3,3)$ & $(4,3)$ \\
\hline 4 & $(1,4)$ & $(2,4)$ & $(3,4)$ & $(4,4)$ \\
\hline
\end{tabular}

Among these, there are four scenarios where the numbers on the balls drawn twice are the same:
$(1,1),(2,2),(3,3),(4,4)$;
There are six scenarios where the number on the ball drawn the second time is greater than the number on the ball drawn the first time:
$(1,2),(1,3),(1,4)$,
$(2,3),(2,4),(3,4)$.
Therefore, the required probability is $\frac{5}{8}$.