An inlay (sometimes also called an "onlay" depending on the design) is a more durable alternative to a filling. Inlays also have better aesthetics.
For the same reasons that you may need a filling: because a tooth has been damaged by decay or trauma.
There are three different types of dental inlay: gold, porcelain and composite.
Your dentist will advise which will give the best results in your case.
If your dentist has suggested an inlay this is probably because the damage is too extensive to be repaired with a composite filling but not extensive enough to warrant placing a crown.
Your dentist will shape the tooth, removing any decayed or damaged material.
Next, they will take an "impression" (ie make a mould) of your teeth and take a measurement of how you bite together.
Your dentist will place a temporary filling while the permanent inlay is being made so that you don't have a large hole in the meantime.
The impression, bite measurements and shade information are passed to a specialist dental laboratory to make the inlay.
About a week or two after your first appointment your dentist will see you for a second time to fit your new inlay using a special dental cement.