As @dd3 points out, average GC% indicates a need for stability and coding regions or structural regions of the genome may need to be more stable. But the largest %GC in genomes are found in thermophiles - organisms which live in high temperature water - in hotsprings and undersea geothermal vents. This review mentions how some thermophiles can be found with 50% GC. The extreme thermophile Thermus thermophilus can have a GC% content of 69.4%.
But you are asking how does GC content get averaged out over the length of a large genome. The answer is variation and selection. When a gene needs to be more stable because of genomic function or because its trying to live in a hotter environment mutations that convert A/T to G/C base pairs will convey an incremental advantage to survival and will tend to be retained in the gene pool as long as no greater disadvantage to the mutation results. Over time and as the stability creates a greater advantage, GC % will migrate further and further away from the mean.
This works for both thermo-tolerance and because of the biofunctional constraints of being a telomere, centromere or a coding region - stability and coding constraints play against each other to converge on an optimal GC content in any given stretch of the genome.
Conversely most genomes have a GC content below 50% are migrating there because too much stability can have a cost as well. Breaking up the DNA helix for transcription and other cellular processes must go smoothly as well for example.
Coding regions are significant for bacteria (E coli is 89% coding sequence). For coding sequences, the genetic code is logically 50% GC on the average, but if you look at the actual codons in the diagram below you will see that except in the case of a single codon case (tryptophan, methionine) the third base always has a GC option, allowing for a GC content in the mid 60 percentiles. The constraint of allowing coding sequences to freely vary is only an approximation - in some cases substitutions to amino acids with GC rich codons might move the cieling up a bit. And the more frequent amino acids have the possibility of making 2 or 3 bases of their codon GC bases. Overall it would be remarkable to find a bacteria with GC% greater than 72%. Mutations and the requirements of proteins being coded for would simply not allow it.
So: over evolutionary periods these GC mutations accumulate where they are helpful, even to the extent of 2/3 of the genome being GC pairs. The strongest selective force to accumulate a high average GC% for a genome is exposure of the genome itself to a high temperature environment.
Note that this thermo-stability argument doesn't count for many animals because they do regulate their body temperatures.