The repeating sequence of physical and chemical properties among the elements, when they were listed in order of increasing atomic mass, was what led to the creation of the Periodic Table of the Elements. Today's Periodic Table is arranged in order of increasing number of protons in the nuclei of the atoms of the elements, with the elements aligned so that those with similar properties are in the same column, or group. It is actually the electrons, not the protons, that give rise to the properties that repeat from period to period, but since a neutral atom has the same number of electrons as protons, listing the elements by atomic number works just fine.
We now know that electrons are arranged around the atomic nucleus in a structured arrangement, and it is the outermost electrons, called the valence electrons, that are mainly responsible for interacting with other atoms, and thus are responsible for both physical and chemical properties. Being very small, electrons have significant wave nature, so their behavior cannot be adequately represented by classical physics, but can be described by quantum mechanics. The derivation is complicated but says that electrons around a nucleus can exist only in certain states identified by their quantum numbers n, l, and m. These states have probability distributions in space that we visualize as shapes, called orbitals. At most two electrons with different values of a fourth quantum number, s, can "occupy" the same shape, or orbital.
The rules for quantum states and the quantum numbers cause each principal energy level to have one spherical s orbital and three dumbbell-shaped p orbitals. Since two electrons can occupy each orbital, these can hold up to eight electrons. It turns out that atoms are most stable when the s and p orbitals in the same level are either all full or all empty. If some, but not all, have one or two electrons, the atom is unstable and will react with other atoms, gaining, losing, or sharing electrons to get to the all-or-nothing arrangement.
The Periodic Table is arranged so the members of the same group have the same number of electrons in their outermost layer, called valence electrons. Thus all of the Group 1 elements have one electron in an s orbital. With the exception of hydrogen, they all lose that electron readily. Then that whole level is empty, and the level below it is completely filled. The tendency to lose their single valence electron gives the Group 1 elements their similar properties. All of the Group 18 elements have the s and p orbitals in their valence level all filled with two electrons each, eight total, so they are stable and tend not to react with anything. All of the Group 17 elements are one short of having completely filled valence s and p orbitals, so their interactions are all governed by the tendency to gain one electron.
All of chemistry is governed by the instability of atoms that have partially-filled "valence shells," the name given to the s and p orbitals in the outermost layer. Depending how many electrons an atom has, it will tend to different mechanisms to either complete or empty the set. Atoms having the same number will tend to react the same way, and since elements having the same number are arranged in groups, groups tend to have the same properties.
This description applies most clearly to the "main-group" or A elements. The B elements or transition metals (Groups 3-12) have one or two valence electrons and a varying number of inner electrons in "inner" d and f orbitals. The properties of transition metals are similar to one another (because of their similar arrangement of valence electrons) and are usually not included in discussions of periodic properties.