Many articles state the machine's capabilities, IO methods, and various statistics, but they never seem to mention how.. Step 1:Get a fancy computer Step 2: ??? Step 3: Computer accurately predicted an election.
I'm not an expert myself, and AskHistorians is known to produce some really rather niche and yet incredibly in-depth answers, but you might also be served by asking this in a more computer science–oriented subreddit, given that you're asking about the construction and programming of a computer, albeit a historical one.
Ira Chinoy made a PhD thesis of this episode in 2010: https://drum.lib.umd.edu/bitstream/handle/1903/10504/Chinoy_umd_0117E_11395.pdf
There's also a nice summary here: https://ethw.org/UNIVAC_and_the_1952_Presidential_Election
It seems there wasn't anything particularly new in the method - this sort of forecasting has been published by newspapers since the 19th century, using results from past elections and past and current opinion/exit polls. What was new here was that, because of the computer, they were able to feed in actual vote tallies as they arrived and update the predictions in near-real time. It was something of a stunt and not without its glitches.