Quality control for generic medicines

Teva is a leading generic drug manufacturer with a turnover of 18.9 billion dollars in 2018.
Generic or unbranded medicines are reported to have become more widely used in the health service due to newer legislation regarding patents. This means cheaper copies are allowed to be manufactured; but is this legitimate?
It is widely known that overproduction in the dairy industry has led to, what is termed a milk lake which refers to surplus milk which is dried, and is believed to be available free to the pharmaceutical industry. It forms the basis for tablets and is listed as lactose. There is a view however, due to capitalism, that storage facilities remain inadequate leading to a substandard product. No quality control for generic tablets means that unsuitable medicine may be ineffective or even detrimental.