To understand why wavelength and bandwidth are linked we should look at how data is actually transferred over the air. Thinking back to the days of Morse code we know that all we needed to do was disrupt the signal and someone on the other end would figure out what was being said. What about sending audio over the air? Now that we need to send more data we have to start modifying different parts of the signal. This is done through Amplitude Modulation, Frequency Modulation (and lesser known Phase Modulation). We more typically refer to these by their acronyms AM and FM.
The EM spectrum moves in waves. It has peaks and valleys. We can alter the height of the peaks (amplitude), the distance between them (frequency) or add a delay or lag to each individual wave (phase).
Amplitude and Frequency Modulation
These are great for sending an analogue signal (like audio from a radio station to your car stereo) but what about sending digital information like Wi-Fi? Digital information is stored in binary as a series of ones and zeros, we can use these existing methods like AM by defining what height of wave translates to a one and what translates to a zero. Unfortunately we run into the aforementioned issue of bandwidth. Sending digital information requires significantly more bandwidth than is available in just these methods. There are many more complex methods that go into sending data over Wi-Fi but I won’t get into them here.
Unfortunately this is where the low wavelength we've been using hits the bandwidth wall. Because the waves are so long we can't send enough ones and zeros quickly enough to be useful. Now we need to shorten the wavelength and crank up the frequency. Older Wi-Fi versions used a frequency of 2.4 Gigahertz, mainly because it was unregulated. Using 2.4 GHz meant sharing a frequency that many other devices we're already using (like your microwave oven) and ended up being too cluttered with other signals that it frequently caused an unreliable connection.
Current versions of Wi-Fi use a frequency of 5 Gigahertz to move away from the cluttered overused 2.4GHz frequency. This meant a cleaner signal and a big boost in available bandwidth. Unfortunately shortening the wavelength again meant sacrificing its ability to pass through walls and effectively shortening the distance the signal can travel indoors.