The behavior of electrons as both particles and waves is a fundamental aspect of quantum mechanics, which is the branch of physics that describes the behavior of particles on a very small scale. This behavior is captured by a principle known as wave-particle duality.
When electrons are not being observed or measured, they can exhibit wave-like behavior. This means that their properties, such as position and momentum, are described by a wave function, which is a mathematical representation of the probability distribution of where the electron is likely to be found. This wave function can exhibit wave-like characteristics, such as interference and diffraction, similar to what we observe with classical waves like light or sound.
However, when we observe or measure electrons, something interesting happens. The act of observation or measurement disturbs the system and causes the wave function to "collapse" to a specific value, revealing the electron as a localized particle at a particular position. This is often referred to as the "observer effect." The collapse of the wave function is a probabilistic event, meaning that the outcome of the measurement is uncertain, but the probabilities can be determined based on the wave function.
It's important to note that electrons do not switch between being particles and waves in a literal sense. Rather, they possess both particle-like and wave-like characteristics simultaneously, and the behavior we observe depends on how we interact with them.
This wave-particle duality is a fundamental aspect of quantum mechanics and is not exclusive to electrons. It applies to other subatomic particles as well, such as photons (particles of light) and even larger particles like atoms and molecules. The behavior of these particles is accurately described by the mathematical formalism of quantum mechanics, which has been extensively tested and verified through numerous experiments.