A Darwinian theory for the origin of cellular differentiation