We study the threshold for chaos and its relation to thermalization in the 1D mean-field Bose-Hubbard model, which, in particular, describes atoms in optical lattices. We identify the threshold for chaos, which is finite in the thermodynamic limit, and show that it is indeed a precursor of thermalization. Far above the threshold, the state of the system after relaxation is governed by the usual laws of statistical mechanics.