Standard American English requires that a comma follow both abbreviations when they are used mid-sentence. It is my understanding that there is no such requirement when using British English.
e.g. stands for "exempli gratia," which is Latin for "good example."Simply, you use it when you're giving an example of something you've already been talking about.
"I really hate artificial chocolate milk, e.g., Yoohoo. That stuff's shelf-stable."
i.e. stands for "id est," Latin for "that is." I prefer to think of it as being short for "in essence."
"i.e." should be used when you want to be more specific or clarify a point.
"Two wheeled, pedal-propelled vehicles, i.e., bicycles, are environmentally friendly."Note: i.e. does not stand for "in example." The incorrect belief that it does indicate an example may be the source of this whole problem.
However, this does not explain why people would use e.g. when i.e. would be appropriate. Any thoughts on that, other than "they don't care" would be welcome; I'm aware that people generally don't care about language.