As you are dieting and trying to lose weight, your metabolism decreases even faster mainly because of the lower thermionic effect of food, since you are eating less, and lower basal metabolic rate since you have less body mass. This is called adaptive thermogenesis.
During this period, your body does not have an idea that you are just trying to get in shape and look good, but instead implements a defensive anti starvation mechanism where it down-regulates hormones like leptin and thyroid hormone. This, together with increased efficiency of movement throughout a day can significantly increase metabolic efficiency and reduce energy expenditure. This is called non exercise adaptive thermogenesis. Very lean individuals can often be very ''sluggish'' as their nervous system is in ''low power mode''. This can save 10-20% of total energy on average, which is enough to stop any fat loss progress if you are not careful enough and too aggressive with your diet.
Now some people believe that this metabolic damage, where everything is slowed down in your body is permanent, and once you reach this state, you simply cannot go back to the healthy and normal condition ever again. A perfect excuse not to try to lose fat ever again, right? Well, fortunately, we have a lot of research about this, and it turns out that this is a complete myth.
It is true that an adaptive thermogenesis, where your experience significant reduction in energy expenditure, is permanent at a very low body fat percentages. But this is fully recovered as soon as you go up in your total body fat percentage. So let's say you diet down all the way to 6%, which is how bodybuilders on stage look like, indeed your metabolism would slow down so much that it would affect your daily life. However, as soon as you go up to a healthy range, 10-15%, your metabolism would increase along with it.
The best study that we have for this is Minessota Starvation Experiment from 1944, lasting 13 months in total. The study was designed to understand how to treat people coming back from war that went through a severe episode of starvation and to understand what are the psychological effects of it.