The effects of relatedness and population structure on patterns of genomic sharing