It’s 1789, and you’re designing a voting-based system. You’ve decided each state gets votes proportional to its population in the presidential election. How do you validate that the result you got from Georgia, two weeks’ travel from NYC, is trustworthy? Seals? They can be tampered with. What about special messengers? Someone could impersonate them.
Solution: send dignitaries that can vouch for each other. The elite of neighboring states is likely to know each other, and you establish a chain of trust up and down the coast. Great!
Except these are people with better things to do than to be errand boys. There has to be something in it for them. Solution: they get to cast the final ballot for President. They are electors.
(This is a theory that I have not validated at all, to be clear.)