Aight, lets set some terms.
A lot of what people call American cheese, isn't. But the term has become used for anything yellow and in a package, despite there being regulations about what is and isn't allowed to be called cheese.
So I'm not going to waste time covering all of that, and I'll focus on the versions that are cheese, or at least were at one point.
So, waaaaay back, long before processed cheese was a thing, American cheese existed in other usages. As far back as colonial days, "American" cheese was just the term the English used for cheddars or other cheeses made in the colonies that also existed in England.
Time passes, and it turns out that American cheese makers grew in skill and range. But there was still "American" cheese. This was usually a form of mild cheddar, often uncolored. You can still find that kind of cheese, if you don't mind it being called mild white cheddar.
So, some bright lads in Switzerland were looking for a way in the early 1900s to make cheese more shelf stable. They were not the only ones, but they were the first. They used ementhal.
Here in the states, James Kraft was working on the same thing, but found a different way there, and using a different base cheese. That base cheese? A mild cheddar.
Essentially, the process in "processed cheese" is taking actual cheese, heating it, stirring it, and adding an emulsifer. That's it. The process just takes regular cheese and makes it both shelf stable, and smoother.
Essentially, when you make any given cheese sauce for something like homemade mac n cheese, and you use flour as the emulsifier, you're doing the same thing to it. It isn't as shelf stable, obviously, but you're processing the cheese.
So, Kraft not only made shelf stable cheese, he did it using "waste" cheese. When you're cutting cheese up for shipping and sale, you end up with little chunks and slivers that are not saleable as they are.
This meant that Kraft's process was inexpensive to produce overall, though it did eventually stop being made of only waste cheese. That led to what's still called "government cheese". It was literally given out by the government in various ways.
Now, the ugly side of things.
Even cheese waste is more expensive than oil and chemicals. So the Kraft company (and pretty much every other mass cheese making company) started fucking with it. Adding in more than just cheese, emulsifiers, and stabilizers. There's shit on the market that gets labeled now as "American slices". But that shit ain't cheese any more than vegan cheese is. That gradual race to the bottom by international conglomerates looking to give as little value in their products as possible fucked up the "American cheese" goodness.
And the original processed cheese was a boon. Shelf stable even without refrigeration, well blended for use in multiple applications, and meeting a bare minimum of flavor requirements. It's the shit that came later that developed the reputation that tarnished all processed cheeses.
If you go shopping, you can still find real cheese that's been processed. Look at the label. It should have nothing but cheese, sodium citrate (or a similar chemical) and maybe something like tocopherol (aka vitamin e) as a preservative. That's it. That's all the good stuff has. There may be annato listed as a colorant, since that's how many cheeses are made yellow.
Typically, you'll only find it in the form of a blend of cheddar and Colby, selected for a mild flavor and easy, consistent melting. Salt levels can be higher than with an unprocessed cheese, so check for that if you're sodium restricted.
But what purpose does it serve? The same as any cheese. It just does it while melting in a smooth, homogeneous way, and lasts longer without going bad
It can also reduce waste, though it has become a product in such demand that chest is produced in quantity just for processing. But there are smaller dairies that process their own out of waste pieces. My uncle used to do so, though after he retired, my cousin took the farm a different way and reduced the things they sell, so he only supplies the family now .
The problem processing solves has already been covered, but I'll sum it up again. It solves shelf stability as the primary, with melting ease being a secondary benefit. The process using heat means that the cheese is pasteurized when it's finished. So it can sit for very long times compared to unprocessed cheese, and even longer than that refrigerated (which also extends unprocessed cheese life)
Refrigeration does solve storage life for unprocessed cheese as well. And, it is dead simple to add emulsifiers when cooking, so the melty factor isn't as big a deal as it used to be.
It is also a very good option when you want a mild, even, predictable taste.
So, check your labels. Make sure you're getting actual processed cheese rather than "cheese food" or (gods forbid) "american slices". That being said, "cheese food" is still mostly cheese, and the rest is typically going to include more dairy products than other things . Those shitty "slices" have no cheese at all, and are not allowed to call themselves cheese here in the US.
Now, this is already long, and there's going to be some short attention span asshole complaining about it.
But let me finish with a fact. All cheese is processed. Period. The only differences are in exactly what processes are used. You take milk, and you use chemicals (be they sourced from something "naturally", or via a lab) to change that milk. Rennet isn't exactly dripping from trees, ya know. It is not somehow superior to sodium citrate by virtue of originally being taken from calf stomachs.
Oh, you didn't know that's how cheese is made? Yeah. Back before labs, rennet was a side product of calf processing. But no matter what's used to do it, you can't make cheese without curds. And making curds means curdling milk. Which is inherently a chemical process.