How do Shopify Upsell Apps Function?

Functionally speaking, how do upsell apps work with regards to product associations?

For example, in the editor, a user will associate specific upsell items to a main hero product. So the hero product has 3 associations:

{Product A: [Product B, Product C, Product D] }

For a common implementation in a public app, are those associations stored via metafields or are they stored in a database? Thinking it though, my assumption is these associations are done via metafields. That way associations can be rendered faster. Any thoughts on how these work? Thanks so much!