Folding the dough (coil fold, stretch and fold) is a typical step that is found in many homemade bread recipes. The motivation for this step is that it contributes to make the dough stronger. What does it mean? How does this action make the dough stronger? What is the impact on the final result?
A "strong" dough is a dough which holds together well. Bread doughs and pasta doughs, when compared to other doughs, are strong in the sense that they are not crumbly, but very cohesive.
Within the spectrum of bread dough, a strong dough is a dough that feels like play-doh. Right after kneading, it sticks little or not at all, it is elastic (wants to return to its original shape after deformation), and when it rises, it is capable of trapping lots of gas.
This is caused by the internal structure of the dough. It is held together by an elastic mesh of a protein called gluten, and when bakers say "strong dough" they mean a dough in which the gluten mesh is stronger than in the weak dough. The mesh is denser and holds together better.
The way kneading (including stretch and fold) makes dough stronger is by creating gluten. Flour contains the precursors of gluten, glutenin and gliadin; when they meet each other in the presence of water, they stick together. When enough of their molecules stick together, they form the mesh, in which the starch and other dough substances stay embedded. The physical action of the kneading makes these molecules meet each other and stick together, creating the gluten structure.
The stretch and fold technique is used mostly in very wet bread doughs, where traditional kneading doesn't work well. It creates a better-aligned gluten than traditional kneading, because you are always working in the same direction. But I wouldn't call the stretch-and-folded dough stronger than traditionally kneaded dough.
How does this action make the dough stronger? What is the impact on the final result?
rumtscho and moscafj have nice explained how kneading works, so I'll limit my contribution to folding that happens after that point.
With some breads, after you knead the dough and let it rise once, you turn it out of the bowl, stretch it out into a rectangle, and fold it over on itself a few times. While this stretching might help further develop the gluten a little bit, the main purpose is to gently deflate the dough a bit, and to move the dough around so that the yeast cells are redistributed and get access to fresh food, leading to a strong second rising.
After the dough has risen and you're ready to shape it into a loaf, you follow a similar process of stretching the dough out a bit and rolling or folding it in on itself. The idea here is to stretch the outside layer a bit so that it forms a smooth surface over the loaf that contains the loaf and defines its shape.
I agree with the other answers but want to add one point about the stretching of the gluten frame as it interacts with the yeast. Think of the difference between a stack of ten bricks and a stack of ten sheets of plywood. The plywood is thinner. When you stretch and fold and again and again, you move the dough away from the brick paradigm toward a paradigm of thinner walls of gluten (and more of them). Those will then interact with the yeast and produce gas, which is trapped by the gluten walls, producing the magic that is bread. Baguettes or ciabatta with big bubbles in the dough tend to correspond to more stretching-and-folding.