An onlay is used to restore a gap caused by a larger cavity that spills over the cusp (raised points) of a tooth, as well as the chewing surface.