Human ears consist of three parts: outer ear, middle ear and inner ear. Sound waves travel through the outer ear onto the eardrum, transmitted through the middle ear to the inner ear in the form of vibration. These vibrations are then converted into electrical impulses and sent to the brain.
When sound waves reach the ear, they pass through the ear canal and reach the eardrum. The eardrum marks the end of the outer ear. When the sound waves hit the eardrum, they cause the eardrum to vibrate. This vibration of the eardrum is then amplified and transmitted through three little bones in the middle ear, and this group of bones is known as ossicles. From there, the vibration is transmitted to the inner ear, which is filled with fluid. The vibrations transmit through the fluid and reach a snail-shaped portion of the inner ear that's known as the cochlea.
The cochlea houses thousands of tiny little hair cells that are affected by the vibration of the sound waves. These vibrations move the top portion of the hair cells, known as stereocilia, and this movement is translated to electrical impulses and sent to the brain. The brain then translates those impulses into sound. Each vibration affects the hair cells in different ways and produces different types of electrical impulses, and thus the brain can discern between various sounds.