The cigarette lighter socket in a car is typically powered by the vehicle's electrical system. When the car is on, the electrical system is providing power to the cigarette lighter socket, so you can use it to charge devices.
However, it's worth noting that the power output of a cigarette lighter socket may vary depending on the car's model and age. Some cigarette lighter sockets may provide a lower power output than others, which may affect the charging speed of your devices. Additionally, some cars may have a cigarette lighter socket that only works when the ignition is turned on, so it may not be possible to charge devices if the car is off.
To ensure that you can charge your devices via the cigarette lighter socket, it's a good idea to check the owner's manual of your car to see the power output and usage instructions of the cigarette lighter socket.