The proper uses of ‘e.g.’ and ‘i.e.’ can be confusing. They are the remnants of a fashion for using Latin phrases in English writing and have been reinforced through use even though hardly anyone really knows what they stand for.
In the first place, therefore, it is very helpful to know that ‘e.g.’ stands for exempli gratia, which literally translates as ‘for example.’ ‘i.e.’ stands for id est, which literally means ‘that is.’ Given that perfectly logical phrases exist in English that can transmit precisely the same meaning, should you have any trouble remembering the differences between e.g. and i.e., it really is better to avoid them.