The software detects when an identical URL is submitted and will mark it as a duplicate (with certain conditions like how recently it was last submitted and whether it had any front page time and discussion).
When similar URLs or different versions of the same story are submitted and get votes/comments, we have to use discretion to work out which URL is best, who submitted first, which discussion is most active/healthy, and we'll try to consolidate the discussion into one thread with the most informative/canonical URL as the main link.