When several versions of a page have identical content, canonical tags are used to identify which version is recommended. They guarantee that search engines index the intended version and aid in preventing problems with duplicate material.