Any officer who sees someone who "appears to be of school age" on the street during school hours can stop that person to ascertain if they are truent.
Jeveniles have fewer rights than adults.
Now as to why?, there are 2 kinds of patrol; pro-active and re-active, when most depts get a high number of calls for service in a certain area they switch from reacting to the complaints to agressively (ie pro-actively) seeking out violations.
They will probably stop when the "stats" reflect the officers have found and taken enough enforcement action on whatever their assignment was, and or when the calls for service in that area dry up.
Quotas in law enforcement are illegal, but dept heads have to report something to the civilians in power, colorful pie charts along with PC speeches about how work is getting done.. so in reality those officers on pro-active patrol are out there knowing they have to scratch out a certain # of citations and make XX of arrests.. that makes the boss happy and the boss can grant vacations, promotions, give you a raise... it pays to be a good troop.
There were plenty of days I drove around finding nothing interesting, and got my anus reamed for it more than once, esp at the end of the month if the shift stats were low, yea we were in competition with other shifts... thats usually when I parked at a stop sign and cited people all day.
I wont even get into where all the fine $$ goes (into the pockets of city politicianc friends) or how small cities actually make $$ from the police dept (and how that can affect the officers pay).
Wanna make a millioin a year EASY??,open a tow yard and get a small city contract.. bribe the mayor to pressure the COP (chief of police) to have his officers use your tow service. more often. By law city jobs must be put to bid.
The mayor will then ok a traffic lane, one of those BS vehicle safety checkpoints that will result in countless impounded vehicles, its the ghetto...nobody has a license or they have warrants. The yard get $70 per vehicle plus $15 per day storage, the city gets a chunk of the fines and the rest is eaten by the courts... MEANWHILE the city keeps all your $$ in an interest earning fund.