Public schools in the UK are first of all private (independent) schools.
In a nutshell, public schools are the most prestigious among all types of independent schools. So all public schools are independent schools but not all independent schools are public schools.
(Confusingly, public schools in many countries outside England are actually state schools).
Freedom to Operate
In the UK, independent schools (as well as being fee paying) are ‘independent’ because of their freedom to operate, to a considerable extent, outside government regulations, though they have, of course, to conform to official standards of education, health and safety etc. are regularly inspected and prepare pupils for the same public exams as state schools.