Some species are natural partners, or even bedfellows
Snapping shrimps build their homes by burrowing into the seafloor, but they don’t sleep alone. At night a shrimp will share its burrow with a goby fish. In return, the fish guards the entrance to the burrow, alerting the shrimp with a waggle of its tail when it spies danger.
This kind of close cooperation between species is known as symbiosis, or mutualism. Other symbionts include Rhizobia, the soil bacteria that live in the roots of bean and pea plants, where they convert nitrogen into nutrients that the plants need to grow (a process called nitrogen fixation).