It is very common to lose a lot of hair when someone goes on a weight loss journey in an unhealthy manner.
Crash diets where you eat very less amount of food and fad diets that severely restrict calories or micronutrients (vitamins, minerals) can result in hair loss. Hair loss with sudden weight loss is a condition called ‘Telogen Effluvium’, wherein sudden fluctuation in the body mass creates stress, which in turn signals the hair follicles to move into an inactive stage or resting phase. This is when many hairs are shed.
It is always advised to have a balanced diet should include enough protein, iron, and other B Vitamins to prevent such associated issues of weight loss. Diets such as Keto that severely restricts minerals and vitamins (since you eat only meat, panner and eggs) often result in hair loss.
Adequate protein is important for healthy hair because hair follicles are essentially made up of a protein called Keratin. One of the B-Vitamins, named Biotin is essential in building such hair protein (Keratin) and also to prevent thinning of the hair and breakage. This is also the reason many hair-health supplements are often a combination of keratin or biotin. The egg is a rich source of both biotin and keratin.
Hair loss can also be caused by thyroid disorders such as hypothyroidism.