The case of octopus and penguin can be understood by reading more on the r-k selection theory and the role of parental care.
Octopuses make a lot of offspring. This helps the species of octopus to survive by increasing the chances of a few offspring to survive out of the many. This is an example of r-selection.
Penguin give birth to only one or two chicks at a time. The penguins need to take care of the chicks unlike the octopus to ensure their survival. This is an example of K-selection with a role of the parents in taking care of the chicks.
Thus both the species survive by adopting two different strategies for reproduction.