In bounded Hamiltonian systems, almost every trajectory returns arbitrarily close to its initial state — eventually
For a Hamiltonian system with finite phase space volume (Liouville's theorem: volume is conserved), almost every initial condition will return to an arbitrarily small neighborhood of itself — infinitely often.
The recurrence time is astronomical: for N gas molecules, T_rec ~ exp(N). For 1 mole (N~10²³), the recurrence time is incomprehensibly larger than the age of the universe. This is why the theorem is consistent with the second law in practice.