In the early days, Thomas Edison favored direct current, because it would drive a motor with more power, such as those used in elevators. But the direct current generated at Niagara Falls had its voltage drop so fast in the transmission lines that it could not be sent to New York City. Along came a Hungarian, Nikola Tesla, who showed that alternating current was more desirable because its voltage could be raised or lowered by transformers, and so it could be transmitted for great distances. So alternating current became the widely used system of today.
An addition to this excellent explication.
In the earliest days there was serious debate whether electricity should best be provided by a large "central station" serving a wide area, or by multiple smaller generators each serving a smaller area. In the latter case a single large building, for example a department store, might have its private own generator to power its own lights (selling any excess capacity to its neighbors).
This latter was the dominant concept, for "central station" made little sense when even the largest generators produced only a very limited amount of power. And indded, shortly after the turn of the century generator-technology had reached its maximum: if piston and shaft were built any bigger, the machine would simply tear itself apart by the force of its own vibration.
At that point Insul of Chicago Edison (formerly of GE) acquired a large site ideal for a large generator (ample access for coal to fuel it). He demanded from GE a turbine-driven generator with 5,000 kwh capacity -- five times the largest prior turbine. They pushed the envelope to 5,000 -- and within a few years of experience using it, Insul's engineers had pushed it up to 9,000 kwh. This huge jump in capacity was decisive in favor of the central-station model.
This turbine was such a breakthrough that when it was finally retired decades later, it was placed on display at GE's site in Schnectady, NY.