For a very long time, large structures were made of masonry: brick and stone and concrete. Masonry is strong when you’re squeezing it (putting it under compression). It is not strong under when it’s being pulled (placed under tension). This is a problem for building roofs. Consider a horizontal beam made out of masonry. Gravity is pulling down on the whole beam, but the ends are supported. So the tendency would be for the middle to droop down – which puts the masonry under tension.
The arch is the one weird trick to solve that problem. The shape of the arch means the higher bricks (say) push on the lower bricks – which is the kind of compression bricks can take. At the legs of the arch, all that weight producews a force pushing down and to the side. If the arch is fastened to the something big, like the earth, that force won’t have an effect, because the earth can push back just as hard.
The roof of a cathedral is essentially a bunch of arches resting on walls. Those walls have to resist the downward force