I believe they are equivalent (they have the same or very close to the same meaning).
They are both used to introduce examples.
I like sports, for example/for instance, football, tennis, and hockey.
"For example" can be abbreviated (shortened) to "e.g.".
I like sports, e.g., football, tennis, and hockey.
The abbreviation comes from Latin (a language that comes from Italy and is considered to be a dead language).
Approximately, 50% of English comes from Latin. Another 30 or 40% comes from the German language.