The percentages in game are the absolute number of that resource divided by the total absolute number of resources on that planet of that class of resource.
There are two classes of resources: Surface Resources (spawn on the surface of blocks) and Embedded Resources (spawn inside of blocks).
A simple example: if you have 200 copper ore, 800 iron ore and 1000 petrolim, the percents will be 20%, 80% and 100%. Since petrolim is the only Surface Resource, it has its own percentage group.
The percentages fail to take into consideration two very important pieces: the size of the world and the average number of resource per block (higher on higher tier worlds). So a 3% on a T4 Homeworld (medium 4.5km planet) might not be “as much” as a 2% on a T6 small 3km Sovereign.