Though the various electronic components of a car are often called its "computer," in actuality a car contains multiple microprocessors, all of which might be called computers. These parts carry out a number of functions, including such diverse tasks as regulating the engine and controlling the windows, seats and on-board diagnostics.
The impetus for the installation of computers in cars was modern emissions requirements; specifically, the installation of the catalytic converter. The catalytic converter is a mandatory part of modern exhaust systems that uses a finely-calibrated series of chemical reactions to remove pollutants from car exhaust, making for cleaner emissions. The catalytic converter requires a tightly-regulated mixture of fuel and air to be traveling through the engine to work properly, so computers, or engine control units, were introduced to most cars.
The ECU is the most powerful computer on board most cars, but it is not the only one. A modern car might have as many as 50 different microprocessors on it, all running specific code designed to accomplish one or more tasks. Before these microprocessors were added, new features had to be hard-wired to switches in the dashboard, clogging cars with complicated wrist-thick bundles of wires for everything from power windows to heated seats. Computers simplify the internal layout while also increasing functionality.