Whether it is prejudice or not is debateable.
It could be argued (as was recently undertaken by the EU in the case of differing premiums for male and female drivers) that to assess the risk of any group by means of gender, age, sexual orientation, occupation, or race (or indeed just about anything else) is prejudicial (that is, the companies are prejudging the risk of all members of a group based on their experiences of a few).
However, insurers need to assess risk. It's what they do to set their premiums. So unless they are going to charge all their policyholders the same amount regardless of their age, driving experience, the car they drive, their driving record and so on, they need to be able to group people into risk categories. Just about any way this is done is prejudicial. It's quite obvious that some young inexperienced drivers will have an incident free record. But many won't. So all of them are placed in a higher risk category. Insurers cannot wait to see how their driving history turns out before setting their premium and only bump it up if they have accidents.