Perfect competition is the only market structure in which resources are allocated in a way that is completely efficient. Of course, perfect competition does not exist in any market in the real world, so there is no market in which there is perfectly efficient allocation of resources.
Other market structures are less efficient than perfect competiton. In other market structures, the lack of competion makes it so that firms do not have to offer the lowest possible prices or produce the highest possible quantities of the good or service they sell. In other market structures, too little in the way of resources is allocated to the production of a given good or service. Buyers are left wanting to buy more at lower prices than is possible in those market structures.
Because of its unfettered competition, perfect competion is the only market structure in which allocative efficiency can occur.