What is the primary function of the main breaker in a breaker box? How does it differ from other breakers?
The main breaker is sized to trip before the total current draw of the panel exceeds either a) the current carrying capacity of the feed from the electric company, or b) the current carrying capacity of the breaker panel bus bar, whichever is less. So if you order a 100 amp service and your breaker panel is rated for 120 amps, then your main panel should have a 100-amp breaker at the top.

The breakers for the branch circuits are rated to prevent the branch circuit from drawing more power than the branch circuit wiring can handle.

If you look at your panel and do the math, it is very possible that the branch breakers have a total capacity greater than the rating of the main breaker. This is fine because you will typically never have everything drawing it's maximum rated current.