weight and engine managment (all the additional emissions diagnostics/DBW) play a big part but it's also the luck of the draw (or bin).
at the end of the 3800 production the machinery is worn out, alot of it actually machined LC3/GN and SI v6's before working on the SII's, and you can bet gm didnt want to invest in rettoling/etc for the last few years of profitability they squeezed out.
the 03/04+ sand cast front covers are a perfect example, since the SI GM has die cast them, the tooling wore out not long after they almost discontinued the SII so it was remachined and used for pressing sand cores which was much less expensive then welding up and/or completly machining new die casting tooling...esp when you can use the die casting equipment with tooling for newer vehicles.
out of the bin the sand cast covers suck compared to the die cast units. ive seen a couple with really bad casting flash right in the oil passages on the inlet to the oil pump
rods are powdered metal forgings...they arent neccesarily stronger, have just as much of a chance of internal defects, but since they dont require several additional steps before they are tossed into the bin, they are cheeper.
valves are shitty (the pressed on hardened tips often have gaps due to shitty fitment, you dont see this in earlier 3800's)
often the heads are shitty esp if they are low mold number units, mold 7 is one of the worst with damn near 3/16ths missalignment in some area's (where a 97 mold 7 isnt bad at all) as the sand mold tooling ages they just machine off the register surfaces and toss it back into production. on the other side of that coin higher mold number heads are often quite nice.
your alot less likely to find really shitty heads on your 98 than an 04+
next time you see a GM bean counter stab em in the kneecap with a pen