In a covalent bond, atoms share electrons in order to achieve a stable electron configuration. In the case of CH4, the carbon atom shares four of its electrons with four hydrogen atoms, resulting in a tetrahedral molecular structure. Each hydrogen atom contributes one electron to the covalent bond, while the carbon atom contributes four electrons. This results in a total of eight electrons being shared between the five atoms in the molecule, which is a stable electron configuration.