Baby birth weight

Diana • Have a daughter. In process for another 😊
What is it based on?? Genetics,diet?? My daughter was 9lb 10oz and 21 1/2 inc long. I noe tall babies run in both side of the family but the weight was much more different. I did gain 50 lbs I honestly didn't watch my weight I was wondering if that caused my very big baby. I am hoping if I get blessed with another baby that I will maintain a healthly weight gain 2nd time around