Video games are rated based on the various categories of content they contain. Regulators look at things like violence, language, and mature themes to decide where a game lands.
For example, a game centered on killing people and committing crimes will most likely land an 18+ rating (an R in America). On the other hand, a gentle game about farming might earn a 3+ rating (an E in America). The rating essentially reflects how suitable the content is for different age groups.