Instead of siting each reference individually, I'll post my most relevant links first, and just say that I'm going to be condensing information on these sites to write my Answer:
https://www.thebalance.com/ach-vs-wire-transfer-3886077
https://www.investopedia.com/terms/w/wiretransfer.asp
https://www.investopedia.com/ach-transfers-what-are-they-and-how-do-they-work-4590120
Wire transfers and ACH transfers generally serve 2 different purposes and have different levels of security with them. Because wire transfers are manually set up and sometimes need a human to verify the transfer was complete, they are more expensive than ACH transfers, which are entirely automated and rarely have any human intervention at all.
ACH
ACH transfers don't need much information, sometimes just routing and account numbers. They don't verify anything, including if the money is there to be sent. They can also be reversed, such as if fraud is reported, if there isn't the money to send, or a couple other situations.
These are also sent as batches, so the overhead of connecting to different banks or credit unions is greatly reduced.
Warning: technical computer content. Feel free to skip.
If you compare it to files on your computer, which they basically are, copying or moving 1000 small files takes more time to move from one drive to another because the computer has to find space, update the file structure, read the source file, write to the new location, and update several other things along the way for each individual file. Also, each file has extra bits of information in the files themselves, including file type specific data so the application that uses it knows how to open it. With a large file, that application specific data is there once, so the same amount of relevant data takes up less disk space, not to mention being able to completely fill more disk sectors rather than leaving multiples partially full when you have multiple files. Once you get through all the setup a single time, then you can just deal with straight data and simply read & write without stopping.
When you transfer the data, you're also transmitting less data with a single file because you have less data to transfer, as I just tried to explain. To get even more computer technical, there's also handshakes, security protocols/encryption, network packet size, and a whole host of other things that go into each connection between banks that's greatly reduced when you only have a single file vs multiple files. Even with all my experience, training, and knowledge in computers, this is still a very simplified explanation of what happens when transferring files, because I don't know all the details, either.
End technical content
ACH transfers generally go through a routing hub, so it's not bank1 to bank, it's bank to one of two Clearing Houses, then the Clearing Houses combine all the transactions by bank and send it on in a single transfer to take advantage of what I said in the technical computer content section. Because it's done in large batches, the cost of each individual transaction become tiny.
However, if you've run a business that takes credit cards, you know that it's not free. You pay for access to a Merchant Account, sometimes called a payment processor, that handles all this for you. They charge a variety of fees. Some are monthly fees, some are transactional fees, some are percentages of the transactions, some are flat fees. It all depends on who you go through. Many companies include this fee in the cost of their products, so you never see it, but some charge percentages based on what payment type you use. I've seen 3%, 5%, or even as much as 10% for using a credit card instead of cash.
These transfers are the small purchases, like a stick of gum, groceries, car payment, car wash, direct deposits, and nearly infinite other daily transactions that you do with your credit card, electronic checks, PayPal\Venmo\Zelle\SquarePay\many more.
Wire Transfer
This is a direct bank1 to bank transfer. Because of this, the originator needs to get lots of information about the destination. When I bought a house, the mortgage company required a wire transfer and specifically refused ACH and any other transfer method. This is because the there's a lot more authorizations to go through, including verification of the destination and guaranteeing the money exists. This is the digital equivalent of a (certified check](https://www.investopedia.com/terms/c/certifiedcheck.asp).
Here is an example of a wire transfer form. When I got my house, the mortgage company had their info already filled out, so I had to fill in my information, send it to my credit union, talk to a specific officer to validate this was what I wanted to do, then the transfer had to be verified it went through afterwards. It was a fairly manual process.
Because it take time for all the human interaction, it costs money, and like all (for profit and many non-profit) businesses, they charge the customer for their products and services. Since it takes someone of a higher trust level, and often higher skill or education level as well as more experience, the person doing the transactions cost the business more to have their time spent doing the transaction, so the bank charges accordingly.
These tend to happen individually, like the small file transfers I mentioned in the technical computer content above. The bank might batch them to all go out at a specific time or even hourly, but it's still a direct connection to each bank, rather than to one of the central hubs, so it takes more time to complete each transfer.
This is also a more direct transfer of money than an ACH. This is you telling your bank to send money to another specific bank. You are the customer of the bank here. With an ACH, for example, it's your credit/debit card talking with a machine that talks to a Merchant Account in less than a second to authorize a transfer, and then the Merchant Account later tells the bank to transfer the money. Here, the customer of the transfer is the Merchant Account, and the customer of the Merchant Account is the retailer, which means there's 2 levels of abstraction where you don't usually see the fees involved.
ATM
An Automated Teller Machine (ATM) is another one of those automated systems that doesn't usually involve human intervention to complete the transfer. These sometimes have fees involved. This is usually put there to, again, cover the cost of the transactions, but it's also to cover the cost of maintaining the machines.
When you have a bank owned network of ATMs, you as a member often get free access as a way to get you to only use their machines, which keeps their transaction costs down. It also help drive people to that bank, as they want to avoid the fees. It also helps drive other people away, so the transaction fees are just avoided.
I'm not going to get into whether these fees are fair or not, because that's more of an emotional reaction and can verge into conspiracy theories all too quickly. I definitely have my opinions on this, but I'm not going to share them, for the same reasons.
Conclusion
Because of the total amount of time and effort it takes to do each transfer, which includes verification, authorization, encryption, and so much more, ACH transfers are considerably less expensive to do than wire transfers. That's why you as the consumer usually don't see the cost of an ACH, but do see it for a wire transfer.
1 - I'm using the word "bank" to also refer to credit unions and other similar financial institutions.