Ratings in search results are always based on real ratings or reviews, which have to be tied to a "thing" Google understands. There are several types of results that have ratings on them, most importantly products. We have a full article on how to get those ratings and reviews showing for your site.