Is it still necessary to trap or over print your artwork in illustrator or Photoshop in 2022? Or does illustrator and Photoshop automatically do this?
Trapping and overprint are two separate issues, so I'll split my answer in two.
No, in general a graphic designer should not have to worry about trapping.
This responsibility lies on the prepress department of your print house. It's not something your design application takes care of. All modern RIPs (Raster Image Processor - the software that interprets the PDF and creates the final images for the printing plates) should automatically apply whatever trapping the print house finds fitting for their equipment.
It's a rather complicated process where lighter inks will bleed a little (around 0.2-0.5 pt) into darker inks where ever they are touching to avoid white lines between inks. It's not applied to each object, but to the flattened final image so it would be very difficult for a graphic designer to make without the proper specialized software.
So when making vector graphics (or sharp 1-bit graphics), you should just focus on making the visual appearance you want. Just be aware of a few things:
Overprinting objects will never have trapping applied. They shouldn't need to be trapped because they print on top of underlying objects and don't knock-out a hole beneath them where there is a risk of registration problems.
Objects should overlap instead being cut out. See this answer.
Thin colored lines or texts on a colored background can be "eaten up" by trapping.
One special case (there might be more) where you might want to manually add trapping to vector graphics would be when working with metallic spot inks. They are special because they should be printed on top of other inks (overprint), but you still might want some trapping applied. See this answer which also contains a quick explanation about trapping in general.
When working with raster graphics, you would normally work with 8-bit (or more) RGB images. The blending of layers performed by Photoshop, will pretty much be WYSIWYG. When later converted to CMYK almost every pixel will contain a bit of each CMYK ink and the colors will fade smoothly into each other. No additional trapping is needed as there is no risk of white lines between inks. There are a few exceptions though.
If you manually construct images in CMYK, you might have objects that don't share any ink closely together (like pure a pure magenta shape on top of a cyan background). Not all RIPs do trapping inside images. And with anti-aliasing you might end up getting a thin white aura around objects. In this case it would be wise to make sure there is a tiny overlap between inks.
Likewise, you might have some images with transparent background which you place on top of colored backgrounds in Illustrator. There is a risk of that same white aura and you would perhaps get a better result if you make sure there is a tiny overlap. I won't go into details with this, as the procedure will differ depending on what exactly you are trying to do.
This answer is somewhat related to these issues.
Yes, as a graphic designer it's up to you to decide whether objects overprint or not.
It's a design decision. When overprinting objects, you are affecting the appearance of the graphics. Does the background shine through or not?
A common issue is overprinting of black text and lines. You should almost always make sure to overprint black text and lines when they are on top of other objects to avoid issues with registration. (For large black headings on top of other objects, you might sometimes want to use some rich black instead.)