If mommy or daddy treats me this way, it must be my fault. A second thing also happens. Children are masters at devising strategies to get love or prevent abandonment. If I'm perfect, then mommy or daddy will love me. But the result will always be disappointing.
Nothing can replace self love.
But like anything worthwhile, it takes effort. The key is in the way we experience our memories of parenting. If our parenting was primarily supportive, our self talk will be so also. If our parenting was primarily negative, we will tend to be self critical much of the time. Some of this self criticism will be a simple replay of what we heard.