each recruiting website has their own "experts" who grade each player. each expert doesn't grade each player, even within one website. There are typically local "experts" who grade their region, and their region only. so there are going to be differences in the metrics/weightings.
there is no objective rules. being bigger, taller, faster, more stats, all help. but there is no set value to each. each "expert" determines their own values.
also each website admits that who is recruiting a player goes a long way to determine how they are graded. a 5'-10" 140lb, 4.6 40, WR with 10 catches and 1 TD recruited by Bama is going to be borderline 5 star, while the 5'-10" 140lb, 4.6 40, WR with 10 catches and 1 TD recruited by Vanderbilt isn't even going to be a 3 star.
they will never admit it, but they will also slide guys up who haven't announced yet, but are leaning towards big schools, even if their stats or measurables don't justify it.
competition: division (A - AAAAAA), including camps, out of state games and the like go into to. and then the certain academies, like IMG, tend to also get favorable bumps.
and the NFL preferences on positions also seems to come into play. there will be a good number of edge, OT, QBs, WR, DTs, CB/S, 5 stars, but fewer IOL, LB, RB, TE.
once the expert determines a kids score, someone nationally will take all the data and start ranking them from the best player to the worst. the score determines their star rating, but how they stack up to others determines if they are 80th player in the nation or 150th.
they update periodically. to complicate matters, several sites do weighted rankings, taking all of the sites scores, and ranking everyone that way too. these "composites" will vary from the host websites score.