The valency of an element is determined by the number of electrons that it can either gain or lose to achieve a full outer shell. The elements in the first group of the periodic table, known as alkali metals, have a valency of 1 because they have one electron in their outermost shell and can easily lose this electron to achieve a full outer shell. The elements in the seventh group of the periodic table, known as halogens, have a valency of 1 because they have seven electrons in their outermost shell and can easily gain one electron to achieve a full outer shell.