To prevent duplicates, Marketo assumes leads with the same email address are the same person. New leads with known emails are automatically merged with their matching lead in Marketo (this feature can be disabled by contacting Marketo support, which was necessary in our case).
More advanced duplicate prevention is available through a variety of tools. RingLead is one of the most popular tools for this, as it integrates with both Marketo and Salesforce. The design works well in most cases, since it sits between Marketo and Salesforce (merging identified duplicates before they sync to Salesforce).
RingLead did not work well for us (because they are focused on B2B matching, which doesn't help us), so we ended up creating a custom tool using the 'duplicate management' feature available in Salesforce.
As for duplicate cleanup, many of the duplicate prevention tools also provide this feature. We use Cloudingo for this right now, although RingLead offers this as well (but RingLead only offers mass/bulk cleanup for records with matching emails, which Marketo normally does anyway).
Both duplicate cleanup and prevention tools require a fair amount of setup, mostly to control how conflicting information in different fields should be handled (e.g., if you encounter a new title for someone, do you keep the old one, or overwrite it with the new title?). Unless you are able to set this up in a way that is completely trustworthy, someone may need to clean the dupes manually (although the tools I mentioned still help, suggesting default values based on your field conflict settings).