On the origin and structure of haplotype blocks