Like ethernet cable, optical fiber. We have a square wave signal, do we just send that squre-wave signal directly down along the cable? If we do send it directly, why we can not send the square-wave signal directly into the air wireless channel? What is the reason behind? Is it because the cable or wire are more stable but wireless is very unstable?
Due to the sharp edges, a square wave has a wide spectrum with lots of harmonics.
You could send that over the air with an antenna, but:
1- Signal shape will be distorted at the receiver due to limited bandwidth
2- It will use a lot more bandwidth than it needs to. For radio transmission you want to use as little bandwidth as you can, and not emit any energy at frequencies you don't use, to leave other frequencies available for other users, other channels, etc. So it would have terrible spectrum utilization. This is why digital signals are excellent sources of electromagnetic interference and noise, and a poor way to make an actual useful transmitter. So, pretty good if you want to make a wideband radio jammer, but not an actual transmitter.
3- It would have very poor SNR at the receiver
4- Unlike cables, radio doesn't go down to DC, so if the digital data doesn't contain the same amounts of zeros and ones, the result would be shifted
That's why a much better choice is to use a modulation and encoding suited for radio transmission. A simple encoding would be AM-modulating a carrier, for example.
tl; dr: RF needs a carrier, cable can use baseband. Both are band-limited, RF systems using carriers more so.
A perfect square wave has infinite harmonics. A good square wave has a large number of them. Because of this, square waves use a lot of bandwidth for the information they carry. They’re very inefficient. This limits their use to lower speed signaling, even on cables.
Look at serdes protocols like PCI Express or Gbit Ethernet. You will see that they don’t use square waves, but more optimized baseband coding to squeeze more throughput out of the cable.
Similarly, a square wave on an RF carrier is very inefficient use of spectrum (though it’s possible - primitive on-off keying does exactly that.) That said, it’s possible to send very-high bandwidth digital data over RF. The challenge is to do that efficiently, within the limits of the spectrum being used, and over a carrier that a receiver can work with and robustly recover the data.
And finally, wireless systems can’t represent a DC connection or low frequency directly. You can only get an approximate derivative of the changes in flux strength at the receiver side. For RF work need to use a coding system that would behave well as if it were AC coupled onto a wire. Using a carrier overcomes this problem.
That said, look into TEMPEST. This is a group of passive espionage techniques that extract information from emissions leaked digital and analog equipment - that is, from baseband waves (square and otherwise) that find their way into RF.
Along with all the bandwidth and other considerations mentioned, the main reason you don't transmit your data directly is that everyone would be transmitting at the same frequency.
Take Ethernet. It uses two (or more) pairs of twisted wires to carry two separate channels of information (your Ethernet card sends data on one pair and receives it on the other pair.)
If you just directly broadcast the signals from each pair, then you couldn't separate them.
The wires confine the signals do that they go pretty much only where they are intended to go.
If you just modulate each onto a carrier, you can separate them - but then you have know which carrier frequency is used for what.
That would work for a few channels, but would get difficult really quick as you add more channels (users.)
WiFi gets around that by having multiple channels and using some intelligence to decide who uses which carrier frequency for what and for how long. It also has WiFi routers which coordinate the end users and actively tries to avoid interference from other routers and users.
The physics of antennas plays a large part. To understand this, you must consider the Fourier transform of your signal. For a simple binary NRZ code, where 0 is 0V and 1 is some voltage, Most of the Fourier energy is contained within the frequency range 0-B/2, where B is your bitrate. But antennas are frequency-selective: at the high end, an efficient non-directional antenna has an effective signal collecting area that declines as the square of frequency. At the low end, efficiency suffers if the antenna is much less than a wavelength in dimension. The entire story is much more complicated than above, but any attempt to ameliorate the frequency dependence in some parameters increases the frequency dependence in other parameters. However, an antenna where the ratio of the highest to lowest frequency of operation is small can have nearly constant parameters over that narrow frequency range. Unfortunately, the NRZ signal has a infinite ratio, since the lowest frequency is zero! Any attempt to send a NRZ signal directly through a pair of antennas will yield an extremely distorted signal.
The usual cure is to modulate a wave that has a frequency, f, that is at least several times your bitrate. This moves the Fourier energy up to a band, perhaps f±B/2, with a small ratio of highest to lowest frequency. Then, antennas are well behaved, and you may recover the received data with a demodulator.
The voltage or current you apply at one end of a pair of wires can be detected directly at the other end. It's like pulling on one end of a tight string -- you can feel the pull at the other end.
When communicating wirelessly there is no quality of the source that can be directly felt or measured at the other end. It's like you're standing in one end of a pool. You can hold your hand at any height and the water at the other end is unchanged -- the height of your hand is undetectable. If you move your hand up and down rapidly, however, you can make a wave that propagates to the other side of the pool where it can be felt and measured.
True square waves do not exist because they require an infinite frequency range, in the real world they will always get rounded off a bit.
Copper and fiber have an awful lot more frequency range than anything you can send over a radio signal and thus they don't get rounded off as much.