A flywheel is an invention that allows kinetic (moving) energy to be stored.
It's not a perfect storage solution because it will lose some of that energy through friction and perhaps air resistance, but storage is the right way to think about it.
Hanging off the back of an internal combustion engine though, it can also be thought of as a bit of a damper, smoothing out spikes in power delivery due to throttle movement.
In terms of terminology, it is the conventional manual gearboxes that see the use of a flywheel bolted to the rear of a crankshaft at the back of the engine, with a clutch's pressure plate bolted to that flywheel, and the clutch friction plate sandwiched between them and splined to the gearbox's input shaft.
Performing the same function in terms of a rotating energy storage device for an automatic, is a flexplate with a torque converter bolted to it. That torque converter uses hydraulic fluid to transfer the drive into the transmission, but the total rotating mass (the flexplate and torque converter rotate together) usually exceeds that of a clutch and flywheel combination (albeit with more of the mass a little bit closer to the centre of rotation, and the further from the centre a mass is the more energy it can store).
This rotating mass is very handy to have, but it comes with some trade-offs as well, depending on how much mass there is.
If you've ever tried to turn an internal combustion engine by hand, or even paid attention to the pulses in the rip-cord for garden engines like lawn mowers or edgers, you'll have felt the resistance caused by a piston during the compression stroke. It feels like an air spring (because it is), and a flywheel (plus any rotating mass it's bolted to, including the crankshaft) provides stored energy to keep the crank turning despite this resistance.
In terms of the total rotating mass, manufacturers of road vehicles tend to install heavier items because they're better for regular street use, which is to say lots of standing starts, parking, low cruising speeds and low rpm most of the time.
Even in competition, the 5-speed WRX I've played with launches noticeably better with the standard flywheel than it did with a really lightweight one. The heavier a flywheel (and the rotating mass it's bolted to) is, the more energy it stores. The faster it's spinning the more energy it stores too.
Leaping off the line, this combination of mass and rotational speed helps overcome the longitudinal traction of the all-wheel-drive system just long enough to keep the revs up, the turbo spinning, and therefore the power production, and several years ago Dad consistently posted the quickest launches (to the first timing marker at about 15-20 metres) of anything at the Canberra round of the NSW Hillclimb Championship one year (faster than even the open-wheeler specials at that particular event).
However, the trade-off with a heavier rotating mass for a conventional manual gearbox is the revs don't drop as quickly when you press the clutch and release the throttle for a gear change. This makes the synchromesh gears of a street synchro 'box work harder, and the gear changes are a bit slower. Even in a lift-and-shift non-synchro racing 'crash' box the gear changes are slower if the revs don't drop quickly.
This energy storage also has an influence over engine braking. The greater the rotating mass, the less effect lifting the throttle has when you're still in gear, which affects how responsively the car reacts to lift-off for controlling things like wheelspin or oversteer. In fact, if a vehicle has a propensity for lift-off oversteer, a light rotating mass is likely to increase that effect.
That gives us another reason why manufacturers lean towards using a greater rotating mass. A reputation for being tricky to drive is not something most brands can survive (old 911s being about the only exception because drivers would get the blame for not knowing what they were doing).
A lighter rotating mass takes less energy to accelerate though, which means that rolling acceleration certainly improves.
So, for car modifiers and race car builders, this rotating mass becomes another choice for tuning and adjusting a vehicle's behaviour in various situations.