In brief
The inverter converts and controls the electrical energy to the motor. It has a different task than the charger.
Useful to know
The inverter connects the high-voltage battery to the electric motor and controls the supply of electrical energy. Bosch describes the basic principle as the conversion of the direct current of the battery to alternating current for the electric motor. [1]
This distinguishes it from the device that receives energy when charging. The fact that they are both power electronics does not mean that they perform the same operation in the same place in the car.
It is practical to draw a simple sequence: battery → inverter → motor. Thus, the question "what component drives the motor?" is separated from the question "how is the battery charged?".
The source discusses various components and integrated solutions. [1] Do not assume that in each model they have separate, equally spaced housings. The scheme explains a function rather than a service drawing or a guide to work on the high-voltage system.
Sources
For further detail and to check the information: