On is an impersonal and indefinite pronoun. It can replace "people or someone", for example, it says "on dit que".
On can also have the same value as "we", for example, "We say that = nous, on dit que". It is used to refer to an imprecise group of people.
As for "ont", it is the "avoir" auxiliary which is conjugated to the present tense: ils ont.
To tell the difference between on and have, you have to put the sentence in the past tense. "On" remains "on" since it's a personal pronoun like "il" or "nous". On the other hand, in the past tense, "ont" becomes "avaient" since it's the auxiliary "avoir".
On est venu ce soir.
==> Nous sommes venus ce soir.
Ils ont trouvé la route.
==> Ils avaient trouvé la route.
Practice this rule with the following exercises : Ex 1 - 2 - 3