An ideal digital signal has infinitely steep edges. We can compose this signal from sines, one fundamental and a number of harmonics.
Neither of those separate sines has infinite steepness. The only way to get our steep edge is by adding an infinite number of harmonics.
The maximum useful datarate is a fraction of the carrier frequency. However, the difference between ZigBee and WiFi has nothing to do with that. 2.4 GHz is so high, that it is not even close to the limiting factor for data rate.
Generally, there are two tradeoffs with higher data rate over the same frequency carrier: RF bandwidth and power.
A perfect sine wave, like a unmodulated carrier, has a bandwidth of zero. As soon as you start messing with that, the bandwidth becomes non-zero. All modulation schemes by definition must modulate the carrier in some way, so all cause the bandwidth of the transmitted signal to be non-zero. This means that signal will use up some finite amount of the RF spectrum. There are legal and practical reasons why you want to keep the amount of RF spectrum space to a minimum. Different modulation schemes have different characteristics, but one way or the other you're going to pay for high data rate with a high spectrum width, or bandwidth.
The other issue is power. This is the main reason ZigBee is much lower data rate than WiFi. I won't go into all the reasons why since it seems off topic to the question and the answer could be a whole book, but it takes more power to transmit a higher data rate at the same signal to noise ratio as a lower one. In some sense, you can trade off data rate with signal to noise ratio at the same power. There are also power and dollar costs in the electronics that have to handle the higher data rate independent of the RF power. Since ZigBee is intended for small low power battery operated devices, a tradeoff was made between data rate, power requirements, distance, and usefulness. Because battery operation was so important, the data rate was made lower. WiFi, on the other hand, had little constraint on the power required for the electronics. Its intended use also demands higher data rate, so a different tradeoff was made.
Best Answer
This is not hard to understand if you grasp the difference between carrier frequency and signal.
The way information is transferred over long distances is with carrier frequencies that are modified just a tiny little bit. A carrier frequency is nothing but a sine wave at some specific frequency; by itself it contains no information whatsoever, because you cannot get information from a sine wave that is always the same.
The information comes from changes that you make to the carrier signal. For instance, you can make a rule that changing the carrier by 1Hz represents a one and by -1Hz represents a 0. Or maybe that lowering and raising the amplitude conveys information. Or one of many other coding schemes.
What is important to understand is that it is the modification of the carrier that conveys information. And this is not something you can do with infinite precision; both the transmitters and receivers are subject to interference or noise that make it impossible to distinguish between very small changes in the carrier. So you always need a finite amount of space around the carrier frequency to convey a nonzero amount of information. This is called the bandwidth, and only it determines your speed. The carrier frequency is not important.
The carrier frequency is important for the total amount of information that can be fit into a certain range of available frequencies. You don't get all the spectrum in the world to work with. For one; higher frequencies can't penetrate large obstacles so they are unsuitable for long-range communication. Some frequencies are also quickly absorbed by the atmosphere. This leaves only small pockets of bandwidth (e.g. 2.4-2.5GHz for ISM, the stuff that old WiFi works on) that are usable and even those need to be subdivided into 'channels' (e.g. 2.40-2.405GHz) to make sure that multiple adjacent transmitters can work without interfering with each other.