They can save some of their income in good times, invest in bank deposits, and draw down deposits in bad times. The bank can then extend credits to other firms. Alternatively, the firms’ owners can hold equity in their neighbour’s firm.
If the profits of the two firms are not perfectly synchronised (or “correlated”), they will “share risks”: if one firm is doing well, the other one is not, and vice versa. Both owners can stabilise their income and consumption and thus insure against the perils of fluctuating profits.