Competitive universities are competitive. Sometimes that competiton is justified and sometimes it is unjustifiably based on pedigree. The program I attended before getting my PhD at a public university was at a well-known private university. But in terms of research productivity and impact, the public university was a MUCH better place to go to school. The PhD program was exceptionally competitive but its undergrad program was not. As a result, many undergrads who wandered through our lab door got a first-class research experience.
I’m not going to pretend that pedigree doesn’t matter (to some people), but it is emphatically not the same thing as “a good preparation.” I took a couple math classes one summer at a low-tier state college. They were just as good as any math classes I took at any of the other places I went to school, public or private.