What makes the cyclic structure of glucose more stable than the open chain structure?
You get to form a C-O $\mathrm{\sigma}$ bond at the expense of a C-O $\mathrm{\pi}$ bond. The single bond has a higher bond energy, even though it is somewhat de-stabilized by the anomeric effect. It's still an overall win, despite taking the entropic hit to confine your molecule into a ring.