Customer teams get exactly the same engine that the works team uses. The reason they don’t perform as well is that they still have to design the rest of their car (which includes a lot of performance impacting design), and they also may have to modify the engine to fit it in their chassis.
This and the difference in resources. Only Red Bull managed to systematically outperform the factory team of their engine (Renault.) McLaren is more on an even ground with them but still a little bit better. Renault is not pouring much money in their car.
And people who like to think about possible unfairness could argue that manufacturers build about 100 engines per season, test them, then pick the ones to keep, the ones to give to customers and the ones that turned out not to be good enough for racing. It's hard to get the very best engine if you are only a customer and you're really competing against the manufacturer and not only an appearance.