Floor trim is used to join two pieces of carpet neatly under a door or archway. Floor trim can come in a variety of materials and finishes usually with a choice of brass or chrome plated. The steel it's made from is usually relatively soft so that it can be cut or hacked to fit the door way perfectly. It's important to use carpet trim under doors because the edges of carpet tend to fray quite badly if left exposed.
There are different kinds of floor trim depending on the combination of materials being joined, if two pieces of carpet are being joined then a double carpet trim is used but there care carpet to tile trim available as well and even carpet to vinyl or vinyl to vinyl. The carpet is held in place by small angled spikes on the surface of the floor trim.