The function of the transmitter is to process the electrical signal from different aspects.
For example in radio broadcasting the electrical signal obtained from sound signal, is processed to restrict its range of audio frequencies (upto 5 kHz in amplitude modulation radio broadcast ) and is often amplified.
In wire telephony, no real processing is needed. However, in long-distance radio communication, signal amplification is necessary before modulation.
Modulation is the main function of the transmitter. In modulation, the message signal is superimposed upon the high-frequency carrier signal.
In short, we can say that inside the transmitter, signal processings such as restriction of range of audio frequencies, amplification and modulation of are achieved.
All these processings of the message signal are done just to ease the transmission of the signal through the channel.