Entanglement and dynamics in many-body systems