Good question. In short, Dmitri Mendeleev noticed that certain properties of the elements repeated, i.e., were periodic. This allowed him to create an initial framework for the elements that had rather intriguing empty spaces. In this way, he predicted as yet undiscovered elements. A periodic table. Eventually these discoveries happened.
A longer version of how the Periodic Table came to be and what it all means, one that I very highly recommend, is the book The Periodic Kingdom: A Journey Into The Land Of The Chemical Elements.
In between, you can watch this recently produced video: