Why does de Broglie wavelength work? The equation is $\lambda=h/(mv)$.
I am currently learning electron diffraction and have learnt about how de Broglie studied on the wave-particle duality of matter such as electrons.
We were given the equation without reasoning of how it works and I am curious to how it works?
I want to understand why it is that mass and velocity of an electron affect the wavelength of it, which in turn would affect the size of the diffraction.
If possible answer in simple terms
 A: It's the way nature works. Blackbody radiation couldn't be understood until Planck came up with the idea of quanta, and his relation between frequency and energy for the photon. This was a big surprise.
For the photon, the wavelength depends on the frequency, and the momentum depends on the energy (or vice/versa). de Broglie then assumed that electrons obey the same wavelength/momentum relation that photons do. This gained credibility from the fact that the orbits in the Bohr atom were integral numbers of waves according to de Broglie's relation, and the Davisson-Germer experiment on electron diffraction confirmed it.
There is no deeper "why". We construct physics from the phenomena.
A: A good write-up of this subject is the Wikipedia article Matter Wave.
Some of the high-lights:
First there were Planck. He was looking at experimental results for black-body radiation, and showed that they made sense if we assume that radiation is emitted as particles, where the momentum was given by $p=h/\lambda$.
Then there was Einstein.  He was looking at the experimental results for the photo-electric effect and they too made sense if we assume that radiation is ABSORBED as particles with the same equation.
Then came de Broglie. He thought that if radiation waves was behaving like particles, maybe particles could behave like waves too.
He did not have any experiments to base this on, but he sat down and did a thought experiment.  Much like Einsteins thought experiment about how light behaved on a moving train, de Broglie started thinking about the same with a massive particle.  How would it have to behave to be consistent for observers on the train and on the platform or other trains?
The actual math is hard, you can find it at the link above.
In the end he sat there with the very same equation $p=h/\lambda$, and published his thoughts.
It is important that unlike Planck and Einstein he didn't have any experiments he wanted to explain.  He was just saying: "Wouldn't it make sense if this was true?"
He was sufficiently convincing that other physicists started doing experiments, and they found exactly what he had predicted, first using electrons and later using larger particles.
And the rest is history.
