What is the difference between e.g. and i.e.?
e.g. introduces examples. i.e. restates or clarifies. They are not interchangeable, and mixing them changes the meaning of a sentence.
They are abbreviations of Latin phrases. e.g. is exempli gratia, "for the sake of example". i.e. is id est, "that is".
The mnemonics that stick: e.g. = example given. i.e. = in essence, or in other words.
The difference matters because one implies a partial list and the other a complete definition.
The policy applies to European capitals, e.g. Paris and Rome — Paris and Rome are two examples among others.
The policy applies to the two largest markets, i.e. Germany and France — that is the full set. Nothing else is included.
A reader who knows the difference will draw quite different conclusions from those two sentences, which is why the substitution is not harmless.
On formatting: both are conventionally written lowercase with a full stop after each letter. American style usually places a comma after them — e.g., Paris. British style commonly omits it. Neither should be italicised in modern usage, despite being Latin, because both are fully naturalised.
A common error is following e.g. with etc. at the end of the list. e.g. already signals that the list is incomplete, so etc. is redundant.
In writing for a general audience, consider using for example and that is instead. They are unambiguous, cannot be mixed up, and cost only a few characters.
Two relatives occasionally appear in academic writing. viz. (videlicet) introduces a full specification much like i.e., and cf. (confer) means "compare with" — not "see", which is a common misreading.
Bear in mind that screen readers often read these letter by letter, so in writing intended for a wide audience the spelled-out English is kinder as well as clearer.