“A transcript from the Constitutional Convention records the official report creating the Electoral College.” – (Image: © U.S. National Archives, CC BY-NC-ND)
Live Science has these two relevant and particularly topical articles to provide explanations rather than speculations.
“Who invented the Electoral College?”
“A history of contested presidential elections, from Samuel Tilden to Al Gore”