If a population is not in Hardy-Weinberg equilibrium that can cause deviations from expectation depending on the assumptions of HW that are violated. If a population violates some of the assumptions (like mutations, migrations and selection) the allele frequencies will change over time. Also, if a non-random mating occurs (like inbreeding), it will cause an increase in homozygosity for all genes.