Public opinion polls have been in use at least since 1824, but it wasn't until the 1920's that they became commonplace. In the 1920's and 30's the Literary Digest
sent out millions of postcards in Presidential preference polls. They received as many as 2 million responses.
The Literary Digest polls weren't that accurate, though. The sample, though large, was not representative of the population and the respondents were self-selected. In 1936 the Literary Digest poll incorrectly predicted Alf Landon would defeat Franklin D. Roosevelt. Roosevelt won in a landslide and the magazine soon went out of business.
In that same 1936 election three men accurately predicted Roosevelt's victory: George Gallup, Elmo Roper, and Archibald Crossley. They pioneered scientific sampling methods. Initially these new methods used quotas to try and select respondents who mirrored the makeup of the general population. Eventually quotas were discarded and instead probabilities were used to reduce errors.
A scientific poll has an uncertainty associated with it (for example, +/- 3.5%) that is dependent upon the size of the population and the size of the sample. In calculating this margin of error the size of the sample is most important. The margin of error number also has a confidence factor attached toi it -- usually 95%. This means that the poll has a 95% likelihood of being within 3.5%.
The major polls have called a Presidential election wrong only once, the infamous 1948 Truman/Dewey matchup. What people forget is that the final result was within the margin of error.
Polls are usually right because math works. Statistics and probabilities are not a matter of faith.