4. As shown in Figure 1, in $\triangle A B C$, the lengths of the three sides are $a$, $b$, and $c$ respectively. Point $I$ is the incenter, $I D \perp B C$ at point $D$, and $A H$ is the altitude. If $B D \cdot D C = I D \cdot A H$, then the relationship is ( ).
(A) $b^{2}+c^{2}=2 a^{2}$
(B) $b+c=2 a$
(C) $a^{2}+c^{2}=2 b^{2}$
(D) $a+c=2 b$
4.B.

Let $p=\frac{1}{2}(a+b+c)$. The area of $\triangle ABC$ is
$$
S=\sqrt{p(p-a)(p-b)(p-c)}.
$$

Since $B D \cdot D C=(p-b)(p-c)$,
$$
I D \cdot A H=\frac{S}{p} \cdot \frac{2 S}{a}=\frac{2(p-a)(p-b)(p-c)}{a},
$$

thus, $a=2(p-a)=b+c-a, b+c=2a$.