This is a great question and a full answer would take a career in chemistry, but I'll try to give you a shorter answer. Have you studied the structure of an atom yet?
An atom is composed of neutrons, protons, and electrons. For a good introduction see:
The neutrons and protons are in the center of the atom and the electrons "orbit" around the outside. Electrons do not orbit exactly the way the moon orbits the earth, but if you think of it that way to start with, it works.
All chemical reactions occur between the electrons of different atoms. When an atom has particular numbers of electrons around it, it is more stable - 2, 10, 18, etc .
If you look at a periodic table, you see that these numbers correspond to the right hand side -- the noble gases -- these are very NOT reactive. They have a stable number of electrons and do not need to react with other atoms. All other atoms have less stable electron numbers, so they react with each other and share electrons to be more stable. The most reactive elements tend to be short one or two electron or have one or two extra. For instance, fluorine (9) and chlorine (17) are short one electron from being the most stable and they are very reactive! Sodium (11) and Potassium (19) have extra electrons and are very reactive. All the rest of the elements in between are less than perfectly stable, so they react with each other to various degrees.
Understanding all the reasons behind the various intermediate reactivities is where the career in chemistry comes in. You are on your way.