Weight gain can be achieved by increasing the consumption of food. However, there are diseases and conditions that prohibit that. Diseases like HIV/AIDS or cancer can cause severe weight loss and malnutrition. Other things like surgery can also cause weight loss.
Medications can be taken to aid in weight gain. Common drug classes used for weight gain are anabolic steroids, cannabinoids, and progestins.