Not often used in fictional writing, these words are in very common usage in academic writing. i.e. and e.g. are both Latin expressions. They mean something very similar, but there is an important, if subtle, difference.
i.e. is the abbreviation for id est and means “in other words” or “that is to say”. It will usually be used when rephrasing something. Example: I love map-making, i.e. getting out ruler, pencil, paper, and measuring and drawing away. It helps clarify your original statement.
e.g. is the abbreviation for exampli gratia and means “for example” or “for the sake of example”. It also clarifies, thus the similarity in phrases, but it clarifies with examples, rather than rephrasing. Example: I love the shapes and sizes of certain countries on maps, e.g. the boot of Italy, the mass of Russia, the peninsulas of Chile or Vietnam. It isn’t necessarily a complete list, but doesn’t have to be. You are simply demonstrating what you mean by your original statement. You aren’t rephrasing.
For example is the English equivalent of e.g. But it’s boring to always say things the same way, and this is a very small way to vary it. And sometimes, when you are word counting or being space conscious, e.g. is also shorter.
One final word on the differences. It is easy to confuse which to use. And even when confusion isn’t present, some writers take a liking for one expression and use it in both instances. I’m afraid I’m one of ’em, using i.e. both to rephrase and give examples. Ah, well. Nobody’s perfect.