Many-body open quantum systems: from dynamics to thermodynamics