Why weight gain occurs in hypothyroidism and weight loss occurs in hyperthyroidism?

Why weight gain occurs in hypothyroidism and weight loss occurs in hyperthyroidism?

Decrease in metabolism (Hypothy) weight gain… Increase in metabolism (hyperthy) weight loss