Apache Mesos is an open source, fault-tolerant cluster manager. It manages a set of nodes called slaves and offers their available computing resources to frameworks. Frameworks take the resource availability from the master and launches the tasks on the slaves. Marathon is one such framework, which runs containerized applications on the Mesos cluster. Together, Mesos and Marathon become a container orchestration engine like Swarm or Kubernetes.
The following diagram represents the whole architecture: