I assume you are talking about the (Scottish) Great Highland Bagpipe.
This needs a history lesson to understand the situation.
The Great Highland pipes were were originally a solo instrument, so the exact pitch wasn't important. The instrument was monophonic (plus the drones, of course) and standard temperament was far from "equal." Some notes that were nominally an octave apart were as much as a quarter tone different from a perfect octave. The usual pitch was somewhat sharper than A=440, but did not correspond to any "classical" pitch standard. Staff notation was not used at all - the "notation" was based on a oral system that represented both pitch and rhythm.
The original Pipe Bands used the same basic instrument. Again, the absolute pitch was not important, so long as all the instruments in a particular band were in tune with each other.
Small adjustments in the pitch and temperament of the chanter are possible, but time-consuming (some adjustments involve changing the diameter of the finger holes!) though the tuning is stable once it has been set up.
Tuning the drones to the chanter and to each other is as straightforward in principle as tuning a guitar, and needs regular attention if the temperature or humidity changes - though some pipers seem reluctant to attempt it!
But when the Scottish military wanted to combine bagpipes and wind/brass bands, they changed not only the pitch standard, but also the intonation of the pipes to match equal temperament. The notation is basically a diatonic scale of D major, but written without a key signature or accidentals, because the traditional playing technique of the instrument did not include any cross-fingerings for chromatic notes. (Alternatively, you can consider the basic scale as A mixolydian, of course). But when used with military bands, the sounding pitch of the instrument was B flat mixolydian, since most of the band instruments are in B flat or E flat.
Since the Scottish regiments provide paid employment for pipers and is thus a natural career path for top-class players, the "regimental" style of pipes have become more or less standard for all types of pipe music, and the introduction of equal temperament has also added new features into pipe band music, such as simple two-part harmony arrangements.
Staff notation in D or A, rather than B flat, has the advantage that the most common note in the many ornaments in bagpipe music (which are essential to create rhythmic articulation, since the tone is continuous) which is a written G in the space above the staff, doesn't require a leger line - though the highest note of the instrument is actually written A.