Chemistry - Why does the cyclization of open-chain glucose occur via the C5 hydroxyl group?

Solution 1:

Due to the internal ring strain the best possible conformation is a six-membered heterocycle in this case called pyranose . A five-membered heterocycle may in rare cases also be formed, called furanose. (From left to right: α-D-Glucopyranose, β-D-Glucopyranose, α-D-Glucofuranose, β-D-Glucofuranose; courtesy of wikipedia)
α-D-Glucopyranose β-D-Glucopyranose α-D-Glucofuranose β-D-Glucofuranose
Including the linear chain form they are all isomers (wikipedia), as they have the same chemical formula. More specifically the relationship between $\ce{linear <-> pyranose <-> furanose}$ is called constitutional or structural isomer.
The $\ce{\alpha-D <-> \beta-D}$ forms are diastereomers, or more specific diastereomeric conformers.

Solution 2:

The cyclic form of glucose uses the C5 oxygen for bonding since it forms a 6 member ring (more stable then either 5 or 7 member ring).

They are isomers since they have the same chemical formula.