If you don't want to read all this just go to the bottom for the bottom line:
There are some parts that might be considered wear items or long term wear items were you rarely get better quality than oem: mainly aftermarket bearings, bushings, ball joints and anything electrical (sensors) are hardly EVER better than oem. SOMETIMES you get lucky and the aftermarket brand that makes the oem part sells the exact same part at a significant savings (I have a Timken Hub bearing that is the exact same part as the Motorcraft hub bearing equivalent but half the price...but that often isn't the case. Oem often get superior parts even when made by the same brand you can buy off the shelf).
Other wear items like oil filters, shocks and struts are sometimes better than oem....but it's reflective in the cost. A good quality aftermarket shock or top tier oil filter generally cost more than an OEM replacement. Your average consumer isn't going to notice or feel something is wrong with a low buck shock or a oil filter with cellulose and rubber ADBV. That's not money well spent. But you will notice if your wheel bearing goes bad, your control arm bushing is half gone or your crank position sensor kicks the bucket. They don't want to be in the business of replacing wheel bearings or MAP sensors for free every 10k miles until the warranty is up or extending warranties because x,y and, z are wide spread known for going bad shortly after the warranty is up. On the other hand some companies don't care. Rarely does a BMW make 100k miles without needing oil filter housing gasket, valve cover gasket or water pump (most use external) if not all three and it's been than way for decades. These are money makes for the dealerships since they don't think their affluent clientele minds spending $1000-1500 a pop on wear item repairs at the dealership. In cases like that really doesn't matter, both oem and aftermarket are going to be trash.
THEN there are markets like Jeep where aftermarket "upgrade" parts may be made considerably more beefy and heavier than oem parts BUT that doesn't mean the attention to detail is better. They'll last longer merely on being built for intended abuse IF you use them as such or you have no choice because your need the adjustability after lifting them that oem doesn't have.
bottom line: bearings, bushings, sensors, electrical parts, timing chains, gaskets stick with oem when at all possibly. The only aftermarket brands I usually trust universally for OEM replacements are Felpro gaskets and Spicer (because they make dang near all domestic oem driveline parts and jeep oem ball joints). You can't trust Moog, Gates, Timken, Gates, Airtex, SKF, Delphi etc like you once could for OEM like quality. You might get it or you might get something that last no longer than an eBay special.