What determines a baby's birth weight?

This might be a dumb question but I was just wondering if birth weight is genetic or what are the factors that go into it. My first son was 8lbs 10oz and me and my husband were only 6lb babies.