Its a bit of a strange one cause according to the Board of Studies, Cells differentiate (that is they take on a specific structure relative to a particular tissue) then they specialise by switching on genes in order to perform a particular function for that designated cell type. In reality, certain genes MUSt be switched on and off for the cell to take that particular structure (differentiate), then other genes are switched on and off to perform the functions required of that cell at various times in its life (specialisation). I have a PhD in Genetics and this is how it was always thought of by us. So when the cell diferentiates ALL of the 30,000 genes are controlled by either being switched off (most of them) or on. The genes that are switched on at maturity determine what type of cell it is going to change into. Once the structure has taken shape, many of these genes are switched off or controlled. The age of the cell and the immediate biochemistry (neighbourhood and tissue, status of nutrients and wastes and other chemicals, hormones and switches etc etc) determines what proteins are transcribed and translated, so therefore what biochemical function the cell will be performing at any one time. This is what the BoS calls cell specialisation. So both processes, the turning of a stem cell into a particular structure and the consequential functioning of that cell are BOTH tightly controlled by the switching on and off of a multitude of genes.
Hope that didn't totally confuzzle you.