The mechanism for acetylation of histones is signal transduction.
When different compounds such as hormones and steroids bind to receptors on a cell they activate a signalling cascade within the cell (note that nonpolar compounds do not require an extracellular receptor - they can diffuse through the membrane and bind directly to nuclear receptors). The signalling cascade initiates PTMs in promoter regions of genes which can silence or activate certain genes. Methylation of DNA and acetylation of histones are two big examples but other PTMs also exist.
Silencing of genes involves condensing DNA by acetylating histones therefore preventing the genes from being transcribed. Activation of genes involves methylation of DNA which makes DNA less condense therefore allowing transcription to occur.
The expression of multiple genes and silencing of others causes phenotypic changes. There is some research showing that majority of PTMs occur when still inside the mother, the mother’s life and pregnancy affects PTMs and they seem to remain forever and can only undergo minimal changes in the life of the offspring. Interestingly most PTMs seem to come from the mother which makes sense as the offspring is exposed to the mother’s body.