In this Spitzer image, the two opposing bubbles are being formed in opposite directions by the powerful outflows from massive groups of forming stars. The baby stars can be seen as specks of yellow where the two bubbles overlap.
When individual stars form from molecular clouds of gas and dust they produce intense radiation and very strong particle winds. Both the radiation and the stellar winds blow the dust outward from the star creating a cavity or bubble.
In the case of the Black Widow Nebula, astronomers suspect that a large cloud of gas and dust condensed to create multiple clusters of massive star formation. The combined winds from these groups of large stars probably blew out bubbles into the direction of least resistance, forming a double bubble.
Photo credit: NASA/JPL-Caltech/University of Wisconsin