Electrostatic interactions hold atoms together. We may think of this quasipermanent glue as bonds. Don't be worried about not have a clear understanding of what bonds are - chemists and physicists have been arguing about it for much of the last 100 years, and our understanding of what a bond is, and what types there are, constantly evolves.
In most situations relevant to chemistry on Earth, bonds are not broken spontaneously in a vacuum. If A is bonded to B to form AB, the bond may become broken when AB comes in close proximity to C, such that A forms a stronger bond to C than it does to B.
Since you mentioned an ionic bond, think of table salt dissolving in water. The bonds between sodium and chloride break, but new interactions are also formed between sodium and water or chloride and water that make it an energy favorable situation.
The circumstances change somewhat in outer space. Even though molecules in space are very far apart, chemistry does happen. Usually due to the interaction of isolated molecules and light, which provides energy to break bonds. By the type the energized fragments lose that energy, they have moved so far apart (the inverse square molecule you mentioned) that the strength of attraction isn't frequently strong enough to pull them back together. Fragments remaining after breaking covalent bonds this way aren't always charged, either, so "random chance" needs to bring such chemicals together rather an electrostatic attraction.
Chemistry is complicated.