Google can show star ratings under a product in search results when the page has structured data (schema.org) that describes the product and its reviews. These are called review rich snippets.
When the A2Reviews reviews widget is installed on your Shopify product template, A2Reviews adds a Product block of JSON-LD structured data to the page. It includes:
aggregateRating: the average rating and number of reviews (added only when the product has reviews).review: a couple of recent reviews with rating, author and text.The rating values come from the A2Reviews product metafields, so they update when your reviews change. See Shopify metafields and Shopify Flow.
Many themes and SEO apps also output Product structured data. Two blocks that disagree (for example, one with ratings and one without) can confuse Google. If the test finds more than one Product item, turn off rating markup in the other app or theme, or ask your theme developer to merge them.