Onlays are considered partial crowns. They are indicated when partial fracture of tooth structure involving cusps occurs or to replace large, compromised unsightly fillings. Onlays are different from crowns in a way that not the whole tooth is reduced but only a part of it is reduced and the sound, uninvolved tooth structure is preserved. Onlays are fabricated in lab and are cemented to natural tooth structure using dental cement.
Inlays are different than onlays in a way that the restoration does not involve cusps, thus normally laying in the center of the tooth, extending to cover the proximal surfaces ( where contacts with the adjacent teeth are) and the sides of the tooth. Inlays are a long-term replacement for fillings because they are made up of porcelain, which is a lot more durable than filling materials.
Crowns, onlays/inlays may also be considered as cosmetic dentistry because they can be fabricated using all ceramics (metal-free) to mimic natural tooth structure.