Apologies if this is not a question and belongs more in discussion, but In dealing with image attachments for a portfolio site, what is the benefit to having images be "attached" to a post versus saving the image IDs as an array in a post_meta field?
The WordPress "gallery" functionality partly depends on the attachment of the media to the post via the
Specifying IDs in your shortcode allows you to include images in your gallery that aren't necessarily "attached" to your post — that is to say, not uploaded from within your post or page. This flexibility allows you to create and embed any number of galleries containing any number of images!
Note: If you choose to just use the "barebones" version of the [gallery] shortcode in your post or page, only images that are "attached" to that post or page will be displayed.
There are probably other ways to answer the questions but that is the first that comes to my mind.
Both the things are same. When an image is attached to a post, an entry is made in the meta table for the attached image's path.
As @s_ha_dum says, standard gallery shortcode is one reason.
Another one is that when you open the media uploader from a post there is an option to show only media attached to that post. It's a good helper in site with a lot of images.
Last one comes now to my mind is that you can use WP_Query to retrieve attachments of a particular post without using meta query so having more performant query (it runs only in posts table).