Coal is a mineral resource beneath the Earth's surface. At various times in the geologic past, the Earth had dense forests in low-lying wetland areas. Due to natural processes such as flooding, these forests were buried underneath soil. As more and more soil deposited over them, they were compressed. The temperature also rose as they sank deeper and deeper. As the process continued the plant matter was protected from biodegradation and oxidation, usually by mud or acidic water. This trapped the carbon in immense peat bogs that were eventually covered and deeply buried by sediments. Under high pressure and high temperature, dead vegetation was slowly converted to coal. As coal contains mainly carbon, the conversion of dead vegetation into coal is called carbonization. The following is a List of countries by coal production for 2016 from
Wikipedia
Million tonnes per year
1 China 3411
2 India 692
3 United States 660
4 Australia 492
European Union 484
5 Indonesia 434
6 Russia 385
7 South Africa 251
8 Germany 176
9 Poland 131
10 Kazakhstan 102
11 Colombia 90
12 Turkey 70
13 Canada 60
14 Czech Republic 46
15 Ukraine 41
16 Vietnam 39
17 Serbia 38
18 Mongolia 38
19 Greece 33
20 Bulgaria 31
21 Romania 23
22 Thailand 17
23 Hungary 9
24 Brazil 8