The factory takes silicon wafers, grinds them down to the right thickness, cuts them up (dicing), bonds wires on, puts them into plastic chip packages, tests them, and puts the finished chips into pretty cardboard boxes with plastic windows that you see for sale in stores.
The testing and manufacturing machines are really expensive. The parent company invested too much in x-ray machines to test BGA chip packages, and almost went bankrupt in the dot-com crash. Management wanted to fire the expensive programmers in the IT department/call centre/automation.
My boss (the founder's son) just finished his Masters in Artificial Intelligence in the US. He wasn't going to let the programmers just leave. So he made a startup company in the same office, spun off, refinanced the loans, and now both companies work together closely but the IT department can also do contracts for other clients to help stay afloat.
Automation tasks are fun when I get them - lots of coding drivers for old hardware in the testing area. Most of the time the factory just keeps running though, so I can do data analysis on the log files to help optimise the scheduling.
Most cards are manufactured at high capacity (e.g. 512GB SD card, 400 GB microSD). When they fail a test, they are "reworked" - the die is cut in half with an electron microscope, and tested again. Thus we get many small cards and a few expensive big cards.
The clients are the people with their name on the SD card, and they're the ones designing the silicon. If they order more, the factory has the capacity. But if the purchase orders are down, we can't make more unless they sell.
tl;dr - It's a market issue, not a factory issue.