What are the advantages of centerline armament?
Yes it's because of dispersion.  With wing mounted guns you normally "harmonize" them to converge at a point, say 300 yards or 600 yards to have a sweet spot where most of the projectiles are passing through a small area to maximize the fire concentration.

But at ranges closer and farther, the streams of projectiles are more dispersed and their effects are reduced.  Watch gun camera footage of strafing runs in something like a P-51, and you can see the bullet strikes widely dispersed and coming together into a tighter cluster as the range closes in.

Putting the armament in the nose eliminates the range issue and you have maximum concentration at any range.  The later versions of the 109 with the Mk108 30mm cannon were just about ideal for this because the cannon was very compact and had a really high rate of fire for its caliber (about 4-600 rpm), so a single cannon + two MGs was plenty of firepower and was probably the ideal configuration for the 109.

The ME262 jet had 4 Mk108s in the nose, providing close to the concentrated firepower of the A-10's 30mm 3000 rpm gattling gun.  A very short burst would bring down any fighter if it scored hits.