Different cells in an organism may have distinct sets of genes even though they have the same DNA. The set of genes in a cell determines the set of proteins and RNAs that give it its different properties.
Gene regulation is the process by which cell controls which genes are expressed. Each cell type has a different set of active genes regardless of the fact that all the cells of the body consist of the same DNA.