How Do Fighters Gain Weight After Weigh-Ins?

If you’ve been paying attention to the UFC or boxing, you’ll see fighters cut up to 20lbs of weight before a fight. They lose all that weight, but put it all back on before they fight. How is this possible? What methods do fighters use to gain weight after weigh-ins? How do boxers lose so much weight for competitions? And what do wrestlers do to get strong again after losing 10-20% of their mass?