We address the problem of two confined one-dimensional particles of arbitrary masses interacting by general short-range potentials. We study under what conditions quantum chaos emerges for the system by analyzing its spectrum statistics. We show that these conditions are directly connected with a specific feature of the underlying classical dynamics, namely, the ergodicity in the changes of the particles momenta. Quantum mechanically this prevents one from obtaining the exact wave function through the Bethe ansatz. Possible extensions for many-body systems are also discussed.