Lots of things happen, but it all involves molecules and atoms that interact with each other. Molecules are made of atoms that come together and stay that way. Carbon dioxide CO2 is made of 1 carbon atom and 2 oxygen atoms.
When molecules are mixed together, they sometimes decide to either lose some atoms, or gain other atoms from another molecule to make a new molecule. CO2 can lose an oxygen atom to form CO, which is call carbon monoxide and is very dangerous, while CO2 is safe to breathe and used by plants to grow.
During a reaction a lot of heat can be given off, like during an explosion, or it can become cold too with heat being absorbed. Molecule bonds, which are very strong, get broken and formed again. I don't think anyone really knows for certain why reactions happen, but it probably relates to the molecules changing to be something more stable with a lower amount of energy. Things that are more stable are less likely to react.
We are lucky reactions exist. If not, we would only have raw atoms which are not that useful to make all the cool stuff, including medicines, that we see in the world today.