The purpose of kneading a bread dough is to form gluten. Gluten is a combination of water with two proteins found in wheat flour called glutenin and gliadin. Kneading the dough causes the proteins to line up and form strands of gluten, which creates a matrix in the dough.
This gluten matrix creates enough strength and structure in the dough to trap gases and allow it to rise. The yeast in the dough produces the gases that the gluten strands trap. When a dough has been kneaded enough, it springs back when poked with a finger. When baked, under-kneaded dough collapses on itself as the gases from the yeast escape the dough.