An inlay is the technical term for a lab-made filling. This means the filling is made outside the mouth on a model of the tooth (indirectly) as opposed to being constructed directly in the patient's mouth with a direct filling. By working on a stone or virtual model, materials such as gold or porcelain can be used, since these require firing in an oven at such high temperatures (around 900 deg C) that would be impossible in the mouth.
These materials are much harder and stronger than the materials used for direct fillings (amalgam, composite or glass ionomer types of cement), so should come with better long-term performance IF the cavity is prepared properly and the inlay is properly cemented. The weakest part of any inlay will be the cement layer which can degrade over time (especially in acidic environments) or break. When the cement layer fails, the inlay may fall out of the tooth and need replacing.
An onlay refers to a larger inlay, that usually extends to cover (rest on top of) a cusp. Onlays are usually made for teeth that have much larger cavities that require cuspal protection, for example after a root canal treatment. Onlays can be made from the same materials as inlays. You may have heard onlays referred to as partial crowns.