There is duplicate content when there are two identical pages in the same site, when a site has the same content that another site, but also search engine robots consider duplicate content if two different URLs bring users to the same page. This is the case when we redirect two domain names to the same site without using a 301 redirection.
The duplicate content is penalized in different ways according to a comment written in the Google blog.