The number of protons affects the number of electrons an element has when it's neutrally charged, and electrons act in some very weird and interesting ways. As you probably already know, because of the way orbitals work, electrons always like to be put together in certain sized groups - groups of eight, for example, are very stable. Because the number of protons determines the starting electronic state of an element, it determines how it will bond to complete its groups and make its electronic state as stable as possible.
The idea that subtle, microscopic changes to structure can have large, macroscopic results on the properties of a system is common in science - get used to it! A person's brain, for example, is a blob of chemicals and membranes with a highly ordered, but still somewhat chaotic structure, whose emergent properties are a person's mind. Fractionally change the concentration of a single chemical in a single small region of a person's brain, and they will often act completely differently. Working out just how such emergent properties are produced is what makes science difficult but interesting.