Side effects occur because while medications target the pathogen causing the disease, they can also affect other cells and processes in the body. This can lead to various unintended reactions. For example, antibiotics may not only kill the harmful bacteria but also disrupt the balance of normal flora in the gut, leading to digestive issues.