Two things need to happen for coalescence to occur: there must be enough energy for bubbles to collide and they need to merge, rather than to bounce off each other.
- When bubbles are small, they do not like to coalesce: due to surface tension, it takes a lot of energy to break a bubbly surface and merge two bubbles together. So, if the conditions are not just right (in terms of their relative velocity and the stiffness of the surface), coalescence does not occur. For example, this is used to create very small bubbles that are used in hospitals to enhance contrast in ultrasound.
- It might be the case that the bubbles we see are actually the result of an earlier coalescence.
The process of nucleation starts at the walls, where very small bubbles are formed. These bubbles are too small to rise, so they stay stuck to the walls and keep growing. So, if the conditions are right (see above), bubbles may slide along the wall, coalesce with another bubble and form a larger one.
This process can go until the resulting bubble has a volume which is sufficiently large, and buoyancy is strong enough to pull it up. You can see this if you look at the walls inside a glass bottle containing carbonated water. Open the cap and check on the walls!
In a can of carbonated liquid, the bubbles at the walls would have to grow a lot in order to meet in the centre of the can and form one large bubble, but buoyancy pulls them away much earlier than that. However in the absence of gravity, you would instead see a very big bubble that might not be able to escape from the can.