All drugs have adverse effects, some worse than others. Taking drugs is about balancing the risks - the perpetual battle of efficacy versus safety.
Clinical study phases are designed around safety, tolerability, efficacy, combination therapy (I.e combinations of drugs) and dose scheduling. Each of these phases can have dozens of individual studies that investigate all kinds of different cohorts; age, sex, race, fitness, medical history, alcohol consumption etc. They are very comprehensive, which is part of the reason why it takes 10 years of studying a drug before it comes to market.
Will some adverse effects be discovered when the drug has come to market? Possibly. Are there any malicious people at pharma companies knowingly putting patient safety at risk for the sake of pleasing the shareholders? Definitely not.
In addition, many people that take drugs for chronic conditions tend to be unwell, or prone to illness. It's very difficult, in a non-clinical setting, to isolate an adverse effect of a drug, to an adverse effect from a chronic condition or lifestyle factors.