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.
An LP (low pressure) hose transports the intermediate air from the first to the second stage. The octopus’ LP hose is usually longer for ease of use by another diver if needed.