It depends a lot on the prep school.
Some prep schools offer very little educationally above local state primaries (except a particular kind of peer group, and separation from the type of children parents paying for education typically want to avoid)
Some prep schools offer something different from, but not necessarily educationally better than, state primaries - e.g. more sport or drama, much more time exploring nature, no testing.
Some prep schools offer a style of education that is more familiar to their traditional clientele than current state schools offer, but again not necessarily better - desks in lines, traditional uniforms, lots of formal testing, lots of homework, focus on manners and neat handwriting etc.
Some prep schools are educationally excellent.
Some prep schools are educationally excellent and offer 'extras' that state schools cannot - daily traditional sport, large grounds, orchestras, on-site theatres, dance etc etc.
Few prep schools are good for children with special educational needs affecting behaviour or learning, though some are good for children with high functioning ASD, and a few private primaries specialise in mild learning disabilities.
Some prep schools are very tightly linked to specific 11+ or 13+ schools, and are geared up to getting their pupils into their linked schools. these are not great for anyone looking for a choice at 11+ or 13+.
Some prep schools are 'stand alone' and target a range of 'public' schools at 13+. These will tend not to prepare children for grammars at 11+.
Some preps, or private primaries, specialise in preparation for schools with 11+ entry, whether private or state grammars.
I live in an area with a few super-selective state grammars, and a high percentage of those entering the most selective grammars have been at private primaries whose selling point is their preparation for the 11+. Of those children I know personally, ALL who have gone to those grammars, whether from state or private schools, have been extensively coached for the 11+, whether through intensive home tuition or through paid-for coaching. None have got in by school preparation alone.