How do cells differentiate to become specialized to a particular function?

Only stem cells are able to differentiate. They do this to create more cells for the variety of organs in your body.