A contraction is two words into one squashed, with an apostrophe marking the missing letters. Saying I'm late instead of I am late is exactly that, like shorthand for everyday speech.
The apostrophe always sits exactly where the vanished letters used to be. In Don't, it replaces the o of not; in I'm, it marks the seam where I and am joined and the a dropped away. That is why saying I'm late instead of I am late works like shorthand for everyday speech: one small mark doing the work of the missing letters.
Picture a friend waving across the street: They're here means They are here. Or a text message: Don't worry stands for do not, with the o of not gone. One small mark doing the work.
Contraction or possessive?
Both use an apostrophe, which is why people mix them up. A contraction puts the apostrophe in place of missing letters: she's for she is. A possessive shows who owns something: the dog's bone means the bone belongs to the dog.