High school coaches in every sport, public or private, recruit. They get mad at the private schools because they tend to be able to get the players they want.
You're putting a very large brush to a situation that is far more nuanced.
Private schools can offer money (not directly; just tuition reduction or full scholarships). Public schools can not. That may go a long way toward explaining why the private schools have more success getting the players they want.
When you get to public schools and recruiting, you have to consider the school district and their policies. The rules vary from district to district, etc. I'm not going to use a broad brush to discuss that, as the situations are so much different from district to district.