a diesel locomotive has a diesel engine that drives an electric generator that produces electric power that supply electric motors that drive the wheels on the rails.
Think of a portable generator powering an electric drill. An internal combustion engine turns a generator that makes electricity which is connected to an electric motor.
Now make the engine a V16 with 567-645 cubic inches per cylinder and a 600 volt, 1000 amp generator driving 4-6 500 hp electric motors directly geared to the wheels. That’s a deisel elctric locomotive.
Dynamic brakes turns the motors into generators and then puts the electricity through a resistance grid to generate heat, which creates resistance to the turning of the motors and the wheels. You basically slow down the train by plugging in a big blow dryer.
Back in 1908 (IIRC) the Dan Patch Electric Line in Minnesota went to buy some boxcab electric locomotives to use on the railroad it was building at that time. However when they pointed out to the builder (Alco I believe) that they didn’t yet have any overhead power wire strung, it was suggested that as a temporary measure, they could order electric engines with an oil burning electric generator onboard. That way they could use the engines until they had the wire up and could convert them to straight electricity.
As it turned, it worked so well the railroad continued using them as “oil electrics”, and never did add overhead wire. The railroad was reorganized in 1918 as the Minneapolis Northfield and Southern, and sold the boxcabs to another MN railroad who converted them to straight electric.
So…basically today’s “diesels” are the grandkids of these engines - electric locomotives carrying their own diesel-powered electric generators.
One of the best things I’ve done is to purchase an operations manual for a SD40-2, even though I knew how a loco worked and have been on one running, etc. You can get different manuals from train shows. I like to look them through before buying. Here’s a few links to diagrams on diesels.
The Lehigh Valley had GP38AC’s which had a 2000 hp deisel driving and AC alternator, then rectifiers that converted the AC current to DC to drive the traction motors. MP15AC’s had the same arrangement.