It feels very counter-intuitive to most of us to throw bread in boiling water. The point of most bread baking, after all, is to let water evaporate and dry out the interior to a certain extent.
Boiling breads like bagels and pretzels effectively sets the crust before it goes in the oven. The water doesn't actually penetrate very far into the bread because the starch on the exterior quickly gels and forms a barrier. Bagels are typically boiled for 30-60 seconds on each side. The longer the boil, the thicker and chewier crust.
In the oven, the fact that the crust is already set means that the bagels don't rise nearly as much. This is partly what gives bagels their signature dense, chewy interiors. (The other part is using high-protein flour.)
Again, how long the bagel was boiled will affect the interior texture. A brief boil gives bagels a thin and fairly elastic crust that will still allow the bagels rise quite a bit in the oven, resulting in a softer texture. A longer boil and a thicker crust prevents the bagel from rising very much at all, giving you a very dense interior.
Sometimes lye or barley malt extract are added to the boiling water. Both of these additions help the crust brown in the oven and also give the crust a distinct flavor. These days, baking soda is often substituted for lye.
How do you like your bagels: chewy and dense, or soft and tender?
Related: Cinnamon-Raising Bagel Ice Cream