There is no difference; K98a is simply the later designation in opposite to the K98b. Beginning in 1923 the German Reichswehr introduced the K98b, which was a modified Gew98 (new sights, bended handle).
AZ means : Aufpflanz- und Zusammensetzvorrichtung.
Also note the "AZ" designation was NEVER used in german nomenclature. That was a myth started in walter's books that persits until today. Kar98a is the 'official' designation of the carbine airboar has pictured. And for clarification the Karab 98b is basically a gew98 with side mounted sling , turned down bolt handle ( like the later 98k ) and the tangent sight in place of the LV rear sight.
There are a number of successive German M98 carbine models all of which are marked on the left side Kar 98 but which differ in details such as sights, stocks, and barrel lengths. Since one type was superseded by the next the Germans evidently felt no necessity to change the designation on the weapon itself. Thus a Kar 98 of 1904 or so differs from a Kar 98 of 1908 but retains the siderail designation Kar 98. The 1908-1918 Kar 98 is currently called a Kar 98AZ as a collectors' designation to distinguish it from its predecessor(s). The Kar 98(AZ) remained in service with elements of the German military, police and some paramilitary organisations right through to the end of World War II with no changes to its siderail marking of Kar 98. In 1923 the Germans began production of the Kar 98b. Some Kar 98bs are marked Karab 98b on the siderail; some are not. To distinguish between the two types both of which were in service at the same time the Germans designated the Kar 98(AZ) as Kar 98a (although siderail markings were not changed) and the Kar 98b as such in contemporary documentation.
I think the reason might be the terms of the Versailles Treaty, or more directly the controls later established under the treaty?
The actual terms stipulated not only how many troops Germany would be authorized but the numbers of Rifles vs Carbines. I have a chart, think it came out of an old Infantry Journal or similar period professional magazine.. it listed Germany as authorized 84,000 "Rifles" and 18,000 "Carbines" with a maximum of 40,800,000 rounds. It lists the artillery, MG's, mortars, ammunition for these too, along with the actual "max allowed" number of officers and men in actual units!
This may have been simply a way to have more Carbine types? Afterall the Germans developed means to get around some of the limitations? For example being stuck with a "max" of 7 Inf Div of 11,000 men & 3 Cavalry Div of 5,500 men -rough strengths - long after Cavalry Div were known to be of little real value.. the Germans improvised utilizing the Cavalry other than anticipated, and they very well may have done so here to have more carbine types? After all the IMKK was gone hardly more than a year or two and the Germans were working on shortening the 98b!
For clarification : the story of the IMPERIAL "Karabiner 98" :
Between 1898 and 1908 the Imperial War Department tried/wanted to adopt a new Karabiner. The first Karabiner was choosed in April/Mai 1900 in 2 modifications :
the "Artilleriekarabiner 98" und der "Kavalleriekarabiner 98"; both looked similar to the K98a, but had a small "Lange"-sight, a flattened bolt handle and no bajonet lug; the Artilleriekarabiner 98 further had a stack hook. The troop trials in 1899/1900 seem to be not succesfull, because in 1902 these Karabiner were rebuilt for gallery shooting.
In 1902 the Emperor approved a new Karabiner, called "Karabiner 98 mit Aufpflanzvorrichtung für das Seitengewehr 98" (Karabiner 98 with bajonet lug for the Bajonet 98). This Karabiner was similar to the Kavalleriekarabiner 98, but had a bajonet lug and the stack hook was replaced by a cleaning rod.
The barrel length of all Karabiner was only 43,5cm (17.1") so it was found, that shooting with this shortbarreled rifles was very exhausting, especially for the shooters on the sides because the "big bang".
In 1905 the War ministry ordered to elongate the Karabiner, so the barrellength grew up to 59cm (23,2"). This Karabiner looked very similar to the Argentine 1909, but had no bajonet lug. This Karabiner was called "Verlängerter Karabiner 98" (Elongated Karabiner 98). But there was a modification of this Karabiner, the "Verlängerter Karabiner 98 (Z)" !!! (Z) was the abbrevation for "Zusammensetzvorrichtung" (stack hook).
At June 11th, 1906 began new troop trials with 706 "Verlängerte Karabiner 98 (Z)", 100 "Verlängerte Karabiner 98" and 70 "Karabiner 98 mit Aufpflanzvorrichtung für das Seitengewehr 98". These trials ended in summer 1907 and with the experience of these trials the different Karabiner were improved to the "Karabiner 98 AZ", which was introduced by Imperial order at february 6th, 1908 as "Verlängerter Karabiner 98 mit Aufpflanz- und Zusammensetzeinrichtung", means "Karabiner 98 AZ". I cannot determine, when the name changed to "Karabiner 98a".