  Given a polarizable $\mathbb{Z}$-variation of Hodge structures $\mathbb{V}$
over a complex smooth quasi-projective base $S$, a classical result of Cattani,
Deligne and Kaplan says that its Hodge locus (i.e. the locus where exceptional
Hodge tensors appear) is a countable union of irreducible algebraic
subvarieties of $S$, called the special subvarieties for $\mathbb{V}$. Our main
result in this paper is that, if the level of $\mathbb{V}$ is at least $3$,
this Hodge locus is in fact a finite union of such special subvarieties (hence
is algebraic), at least if we restrict ourselves to the Hodge locus factorwise
of positive period dimension. For instance the Hodge locus of positive period
dimension of the universal family of degree $d$ smooth hypersurfaces in
$\mathbf{P}^{n+1}_\mathbb{C}$, $n\geq 3, d\geq 5$ and $(n,d)\neq (4,5)$, is
algebraic. On the other hand we prove that in level $1$ or $2$, the Hodge locus
is analytically dense in $S^{an}$ as soon as it contains one typical special
subvariety. These results follow from a complete elucidation of the
distribution in $S$ of the special subvarieties in terms of typical/atypical
intersections, with the exception of the atypical special subvarieties of zero
period dimension.
