The function of the battery in an electric car is as an electrical energy storage system in the form of direct-current electricity (DC). If it gets a signal from the controller, the battery will flow DC electrical energy to the inverter to then be used to drive the motor. The type of battery used is a rechargeable battery that is arranged in such a way as to form what is called a traction battery pack.
There are various types of electric car batteries. The most widely used is the type of lithium-ion batteries. Please read the article “Electric Car Batteries and Their Characteristics” to get a little idea about batteries for electric cars.