That's a block heater, as mentioned above.
It keeps your engine warm so it will start in the cold. Keeps the oil thin so the engine turns over easier.
You can get battery warmers, too. But if you have a good battery, and a plugged in block heater, the oil will remain thin and even a weak battery will start the car.
I have acquaintances in Northern Canada that will actually leave their vehicles running 24/7 in the real cold months of winter. It can get chilly up here!
