6. Given that $A B C D-A_{1} B_{1} C_{1} D_{1}$ is a cube with edge length $a$, $E$ and $F$ are moving points on edges $A B$ and $B C$ respectively, and $A E=B F$. If the angle between $A_{1} E$ and $C_{1} F$ is minimized, then $(\quad)$.
(A) $A E=B F=\frac{1}{4} a$
(B) $A E=B F=\frac{1}{3} a$
(C) $A E=B F=\frac{2}{5} a$
(D) $A E=B F=\frac{1}{2} a$
6.D.

As shown in Figure 1, extend $C_{1} F$, $A_{1} E$ to intersect the extension of $B_{1} B$ at points $P, Q$ respectively. Draw $P M / / A_{1} E$ intersecting $A_{1} B_{1}$ at point $M$, and connect $C_{1} M$. Then $\angle M P C_{1}$ is the angle formed by $A_{1} E$ and $C_{1} F$, denoted as $\angle M P C_{1} = \theta$. Let $A E = B F = x, 0 < x \leqslant a$. It is easy to prove that
$$
\begin{aligned}
B P & =\frac{a x}{a-x}, \\
B Q & =\frac{a(a-x)}{x}, \\
B_{1} M & =\frac{a x}{a-x} .
\end{aligned}
$$

Thus, $M C_{1}^{2}=\frac{a^{2}\left[(a-x)^{2}+x^{2}\right]}{(a-x)^{2}}$,
$$
P C_{1}^{2}=\frac{a^{2}\left[(a-x)^{2}+a^{2}\right]}{(a-x)^{2}}, M P^{2}=\frac{a^{2}\left(x^{2}+a^{2}\right)}{(a-x)^{2}} .
$$

In $\triangle P M C_{1}$, by the cosine rule we have
$$
\cos \theta=\frac{M P^{2}+P C_{1}^{2}-M C_{1}^{2}}{2 M P \cdot P C_{1}} \text {. }
$$

Therefore, $\cos \theta=\frac{a^{2}}{\sqrt{x^{2}+a^{2}} \sqrt{(a-x)^{2}+a^{2}}}$
$$
\begin{array}{l}
=\frac{a^{2}}{\sqrt{x^{2}(a-x)^{2}+a^{2}\left[x^{2}+(a-x)^{2}\right]+a^{4}}} \\
=\frac{a^{2}}{\sqrt{\left(a x-x^{2}\right)^{2}+2 a^{2}\left(x^{2}-a x\right)+2 a^{4}}} \\
=\frac{a^{2}}{\sqrt{\left[\left(x-\frac{1}{2} a\right)^{2}+\frac{3}{4} a^{2}\right]^{2}+a^{4}}} \\
\leqslant-\frac{a^{2}}{\sqrt{\left(\frac{3}{4} a^{2}\right)^{2}+a^{4}}}=\frac{4}{5} .
\end{array}
$$

Therefore, when $x=\frac{1}{2} a$, $\theta$ achieves its minimum value $\arccos \frac{4}{5}$.