Not knowing what you might already know, this cannot be answered without background information. I have to start however with believing you know the difference between AC and DC electrical power.
A 3 phase AC motor rotates (works) by following rotating magnetic fields created by the application of AC voltage on the 3 phases of the stator (stationary portion) windings, which induce another magnetic field in the rotor (rotating portion) of the motor. As the fields rise and fall from one phase to the next, the rotor field "chases" them (or is pushed ahead of them, whatever way you want to think of that).
The speed of rotation is dependent upon the frequency (Hz) of the voltage that is applied to the stator. The motor torque is also dependent upon the voltage level (magnitude) applied to the stator. If you change only the frequency, the motor speed changes, but the torque and thus the power is affected. If you change just the voltage, the torque and power is changed, but the speed remains the same. To be effective, an AC motor must maintain a constant ratio of the voltage and frequency.
A VFD creates a "pseudo" (fake) AC voltage going to the motor using DC pulses and a methodology called "Pulse Width Modulation" to make the motor "think" it is seeing a varying magnitude of AC voltage getting to it. By changing the width of a string of DC On-Off pulses, it changes the RMS voltage (RMS = Root Mean Squared, a form of "average") getting to the motor. This is because although the DC pulses are changing rapidly from 0 to full DC voltage, an inductive coil, such as a motor winding, cannot change state faster than what is called the "inductive time constant" because of the interaction is has with the iron core of the motor. So the rate of rise of the voltage as seen inside the motor is more smooth. Changing the width of the On-Off pulses and gaps between them can make the RMS voltage appear to rise or fall. Then by changing the rate at which the string of pulses change from positive to negative, it changes the relative frequency of that RMS voltage. The VFD changes both the frequency AND the voltage at the same rate as what the motor was designed for, so the motor can continue to function at rated capacity while changing the speed.
That's about as brief as I can make it.
__________________
** All I every really wanted to be, was... A LUMBERJACK!.**