What exactly does the RatingWidget JavaScript code do?

It replace all rating containers elements inside the HTML markup with a beautiful ratings. RatingWidget’s code snippet grabs the site’s RatingWidget ratings from rating-widget.com and then loads the most recent ratings data into the page.