Octopus, also called a buddy regulator or an alternate air source, is basically the same thing as the primary second stage.
It does the same job through the same process as the primary second stage, however, it is used as a backup.
In the case of emergency, such as a fellow diver running out of air, the alternate second stage can be used to allow them to share from your air tank.