Their cases are better than most pc cases (most, not all) but that is it. The rest is of exactly the same quality. If you were told different you were lied to.
That's not the whole story though. While the parts may be coming from the same factories, the way the parts are combined make a big impact to the final product.
For better or worse, Apple only uses a small selection of all parts that are available. Which, arguably, restricts a user's choices. However it means the whole package (OS and HW) can be optimally tuned (in theory at least, and in my experience is usually true). Non-Apple PCs are often assembled without a lot of thought about how all the parts are going to work together, and then they often leave it up to the OS provider to figure out the optimal settings within the OS.
Usually it works out. But how often do our Windows colleagues need to find, download, and install some software to resolve a driver incompatibility. How often do we hear about our Windows friends having to resolve a DLL conflict. At least they got past the IRQ conflicts a couple of versions ago.
Windows has an immense challenge - it needs to know about just about every kind of HW it might encounter, and to know how to resolve issues when two pieces of HW don't get along well, or if the SW that drives the HW is conflicting with other things. It is actually a tribute the MS programmers that they can make Windows work as well as it does!
Apple doesn't have that problem. They just need to make the OS work with a very small sub-set of HW parts. And it they can't make a part work well, Apple won't use that part. Problem solved.
Also keep in mind that just because the specs on the outside of the box list better numbers, doesn't mean that the user sees better performance. There's no point putting a kick-tush fast HDD into a laptop if the memory controller throttles the transfer speeds because the computer maker picked an incompatible (but $cheap) north-bridge (or south-bridge, I don't know).
And one final thought. Many many non-Apple PC companies change the versions of the parts going into a single model of system over time. Makes it even more difficult to tune the system since you need to know which parts, and which versions of each part, go into each system.
I like the boring-ness of my Macs. Boring. Predictable. Reliable. Get the job done.
And people wonder why old Macs hold their value so well.