It is a well known pharmacology fact that every drug will show side-effects beyond certain dosages. Or rather every drug can be a poison at certain dosage. The objective of drug design is to come up with a molecule which shows the maximum targeted efficacy with acceptable side-effects. For drug design and discovery, a cell view can be simplistically thought of as a huge network of proteins which are linked by different mechanisms which form the nuts and bolts of the biochemical structure of the cell. These cells put together form different organ tissues. The organs put together constitute the human body. For designing a drug the designer needs to identify first which biological target (type of protein) and it combinations to target in the specific cell type. Then the next stage is to come up with drug molecule which can be administered and which will bind to the target protein to achieve desired effect. Hence the drug discovery process starts with a Biology focus and transitions to Chemistry focus with tight iterative loop between the two.
The bad and ugly side of the drug can be due to biology or chemistry