In architecture, a keystone is the last wedge-shaped stone, or voussoir, that is set in place when making a masonry arch.
It is sometimes called a capstone for that reason, but the keystone is not simply a finishing stone; it’s what makes an arch work by locking all the stones in place. If you built an arch and forgot to put in the keystone, all the other voussoirs would just fall down into a pile on the ground.
To do its job, the keystone need simply have the same wedge shape as the other stones, but it is usually made bigger to stick out at the top in a proud decorative style.