There were several types of generators. Generators were classified by both type of service and by the type of prime mover which motivated the generators.
Ship's service generators were designed to provide electrical power to the ship during normal operations. The sizes that I saw ran from 500 Kilowatts to 1,500 Kw, with a voltage output of 440 volts. The motive power was either a steam turbine (a turbogenerator), a diesel or a gas turbine. Therefore you had SSTGs, SSDGs, and SSGTGs.
Emergency generators were fitted to some ships. These generators provided less power than a ship's service generator. They were either diesels or gas-turbines, as Solar gas turbines were fitted into the bows of some cruisers. Steam, for reasons that either are or will soon be obvious, was not used to power emergency generators. Therefore you had EDGs and EGTGs.
Some ships did not have emergency generators. The Knox class frigates had diesel generators that were of the same rated output as the SSTGs, they had one SSDG per ship.
Motor generators were driven by electrical motors. I wrote about LAPS here, the MG set which provided transmitter power to the SQS-26 sonar system. There were other MG sets, including one or more which provided 400Hz AC power for use in parts of the sonar and fire control systems. 400Hz power provided for much finer control than did standard 60Hz power; there were probably other reasons, which were explained to me in some boring electrical class and which I forgot as soon as I took the test.
Let's now consider the steaming of a Knox class FF and its electrical plant, which was about as simple a plant as there was. A Knox class ship had two boilers in one fireroom; one boiler was steamed for normal operations. Just forward of the Fireroom was Aux 1, which contained three SSTGs, each of which was rated for 750Kw. During normal steaming, two of the SSTGs would provide power to the switchboard in Electrical Central; the third SSTG would either be in standby or would be offline for routine maintenance.
Aux 2, which was well aft of the main plant, contained a SSDG and a separate switchboard. This was a very large unit, consisting of two V-16 GM diesels that drove the generator, and it was loud enough that double-hearing protection was required during operation. During normal steaming, the SSDG was offline and aligned for automatic start in the event that power was lost. Some ships would start the SSDG and bring it on-line for activities such as entering or leaving port or underway refueling; this ensured that if the plant failed for any reason, electrical power would not be lost at a time when having rudder control was vital. The SSDG was also aligned so that in port, if power was lost, the SSDG would start up (unless it was down for maintenance). If power was lost underway and the SSDG didn't start, you were shit out of luck.
If power was lost, whether underway or in port, the enginemen and the electricians would man up the SSDG and the After Switchboard. (In port, the electrician would immediately trip the breaker for the shore power lines, to prevent "feeding back" to the pier. ) Loss of electrical power underway meant that the boiler(s) had fires pulled, as there were numerous pumps in the main plant which were driven by electrical motors, including the condensate pumps, the main feed booster pumps and the fuel oil service pumps. Electrical devices throughout the ship were either on LVR or LVP switches. LVRs tripped off when there was low voltage and automatically came back on when there was enough voltage. Lighting and security systems were on LVR relays. LVPs were on items that were either not vital or that the power drain was such that it was not desirable for all that stuff to come on at the same time.
Underway or in port loss of electrical power triggered an automatic security alert, where teams of sailors with guns would arm up and fan out about the ship to secure vital areas.
Underway, the boiler techs would work as fast as possible to get the boiler back on line. This was usually little more than use a periscope to look inside the firebox for spilled fuel and if none, start the light-off blower, get fuel recirculating through the lines and light fires. Once fires were lit, the boiler stops were opened, the SSTGs would start rolling over and as soon as the boiler was up to pressure, the SSTGs would be brought back on line and the main engine would start turning.
As the old saying went, for the screws to turn, the fires must burn, so Engineering was matter of "turning and burning."