The quality of state provision varies hugely depending on which State you're in.
The quality of US public schools can vary even more depending on which town you are in, and the specific school in large cities. If you must consider public schools from a distance, start by looking at which AP courses they offer, the average SAT/ACT scores and, perhaps most important, the median income of the catchment area. Be aware that most public schools outside major cities have strict catchment areas.
an American High School Diploma equates to GCSEs in U.K.
An American high school diploma does not not equal GCSEs especially if the student has taken AP exams.
Both these statements are correct. An American high school diploma in itself, or a GED, is roughly equivalent to "passing" GCSEs. AP tests are roughly equivalent to A Levels; both types of exams cover roughly the content in typical first year American college courses. Bear in mind that most UK university courses are 3 years while the most US college courses are 4 years.
The IB is far closer to the US high school curriculum than A levels.
The IB is closer to the curriculum at a good US high school. Poor US high schools will not mandate (and may not provide) the breadth (or depth) of an IB course.
A GPA of 4.0 in my experience is way easier to achieve than an A average at A levels or 40plus points at IB.
Different high schools will have different GPA distributions. Some schools will have median GPAs below 2.5 (on of a 4.0 scale). Some schools may have median GPAs above 3.5. There is no standardization of grades between different schools. That is one of the reasons why the SAT and ACT are so important. Top American colleges generally look at class ranks rather than raw GPAs.
State secondary education in the US is very different than in the UK. The vast majority of funding is provided at a state or local level and, in most states, the majority of funding is provided locally, typically from property taxes. This often leads to immense disparities in funding between schools in well-to-do neighborhoods and poor neighborhoods. Even within the same state, around the same city, one school might have three times the per-student funding of a school just a few miles distant.
Some American high schools don't offer even the Calculus AB AP course (effectively a subset of the Maths A Level) and cannot educate students to either A Level or IB standards. Other high schools offer 20+ AP courses and will have top cohorts who take 6+ AP exams. The tremendous inequality in the US public school system results in some very poor schools but also some schools which quite possibly provide better opportunities for high achievers than any UK state school.