The calculation of PPP is a very complex, resource consuming task. As you can imagine, coming up with a single number comparing countries relative purchasing power means many assumptions have to be taken (i.e there is a trade-off between realism and simplicity).
The most comprehensive documentation relating the methodology behind PPP can be found in this World Bank website. Here I just give a brief idea of what's going on. Check the documentation for further clarity (particularly Chapter 4).
The calculation of PPP goes in stages. First, data on prices of individual products within a basic heading (a macro category, e.g. food) is computed. From here, relative prices for each product across two countries are computed, and aggregated at the basic heading level using a geometric mean. An example is given in Table 1 of Chapter 4, copied below:
Then, an important issue is product choice. Comparability depends on products being relatively homogeneous in both countries, so that table above can be filled in completely. This requires an adjustment for product quality when necessary (e.g. mobile phones), part of which is adjusted using hedonic regression (see page 15+ of Chapter 4). Additionally, products must be representative on each country, simply defined as (see point 7 in Chapter 11 for a technical definition):
A representative product is one that is purchased in relatively large quantities in a country.
Several mechanism are used to adjust for imbalances among these two factors (including weights).
The list of problems continues. Which price to include? As the documentation states:
The price at which any single good or service is purchased is liable to vary considerably during the course of a year and also between different locations, especially in large countries. In these circumstances, the PPPs for individual products have to be defined as ratios of average prices.
Finally, Chapter 8 deals with Government services like health and education, There is a differentiation between individual services (household consumed) and collective services (public goods). Most of education and health as services provided to the individual is the former, whereas others like R&D in education and health is the latter. See Box 1 in Chapter 8 for a complete list.
The valuation of these services is an issue. A quote in extenso might help here:
Most of the individual and collective services produced by government are non-market services. They are either provided free to individual households or the community as a whole or they are sold at artificially low prices that do not reflect their costs of production. As there are no market prices the value of the government’s current expenditures on non-market services has to be estimated in the national accounts by the current value of the inputs used to produce them. Similarly, as there are no market prices the PPPs also have to be estimated indirectly using other data. The same problem arises when trying to measure changes in the prices of government services over time within a single country.
The solution usually adopted in both international and intertemporal price and volume indices is to compare the prices and volumes of the inputs used in the production of non-market services instead of the prices and volumes of the outputs. When the PPPs compare input prices the resulting expenditure data when converted into a common currency compare the volumes of the inputs used up in the production of non-market services in different countries. Input volume indices inputs can provide close approximations to output volume indices but only if the ratios of outputs to inputs, i.e., productivity levels, are the same in different countries. This may often not be case. PPPs based on input prices are therefore second best measures that are necessitated by the lack of output prices
See the chapter for more details.
In conclusion, there is an attempt to provide homogeneity across goods and services. But there are many reasons why perfect comparability might not be achieved. In the case of government services, if inputs do not reflect outputs homogeneously across countries (partly due to productivity differences, as highlighted above), this will affect PPPs.