Your carpet joins may be split or perhaps the carpet has come away from the metal joining strip beneath the door. Split seams can sometimes be repaired by being broken open and re-seaming.
Carpets that have come away from door bars can be repaired sometimes by stretching and sometimes by fitting slightly wider door bars.