Those were the telecoms, transport, and infrastructure companies of their day. They connected the industrial and agricultural output of the United States in much the way Apple, Amazon, Boeing, Verizon, and Walmart (all current components of the DJIA) do today.
That said, yes, it's interesting to watch how the components and industrial sectors represented change over time.
The first DJIA proper (26 May 1896) featured cotton oil, sugar, tobacco, gas & coke (coal), cattle feed, electrical utility, lead, railroads, leather, rubber, and a holding company (trust) largely engaged in utilities and transportation, and dropped later the same year, along with US Rubber. Changes to the average have been a consistent feature to its origins.
Think of those which aren't directly comparable to modern concerns (e.g., oil & gas, electric utilities) as raw materials (mining and ag), transport and logistics, and food (or feed).
Many exist.
This is how it has always been.
It's not that useful now that we have computers, but in the early 1900s it was a reasonably good approximation of a market cap using fast math.
On which point, John K. Galbraith's The Great Crash: 1929 (1954) remains an excellent history of those events (and notes the DJIA's value frequently), as well as a general primer on equities and investments, and how they may go wrong.
1. sum 500 of the biggest companies by size (price * n shares).
or
2. have WSJ editors select 30 companies by any criteria they see fit, but you don't get to see the size of the companies, only the share price.
The way that the DJIA changes isn't the same as an index of, say, the n most highly capitalised equities might (Fortune 5, 10, 20, S&P 500, etc.).