He observed that rubbing amber with fur caused it to attract light objects. This is now known to be due to the triboelectric effect, where friction between two materials causes a transfer of electrons, creating a static charge.
Thales didn't create the charge, but rather discovered and documented the phenomenon. He was interested in explaining natural occurrences, and this observation led him to theorize that the amber had acquired a soul or spirit that caused the attraction.
It is important to note that the understanding of electricity as we know it today was not developed until centuries later.