Not true. Apple is super disciplined about profit margins. Each business has to be sustainable on its own and each product sells with a hefty margin or is doesn't make the cut.
What does similar specs mean? Just looking at cpu for the first set of results I found[1], one has to go back to the iPhone 11 (released 2019) to find one performing worse than a non-iPhone. Results are closer for multicore and maybe the comparison/benchmark I found was bad for one reason or another, or maybe you mean other specs like the size/weight or cameras.