This is from an English cartoon on youtube I Don't Want to Comb My Hair! It is about a little princess who hides combs from the nanny because she doesn't want her hair to be combed by her.
Mother: Princesses must comb their hair.
Princess: But I don't like it when she does it! She pulls!
Apparently, she doesn't have problem with her hair to be combed, but she doesn't like it when combing is done by a particular person.
So, in such situations I would expect a sentence structure such as "I don't like her doing it!"
But apparently, the sentence "I don't like it when she does it!" seems to have the same meaning although the sentence is made up using "when".
So, these two structures both seem to have the same meaning, do they really?