Till few years back Qatar total military strength was merely around 12,000. Nato has the largest presence in gulf @ qatar and as MBS & saudi monarchy once said, if US forces are out of qatar, Doha will fall within four hours.
So exactly on UAE & Saudi pattern, Qatar opted pakistan armed personal specially after blockage by its neighbors. They can't trust iran as then it proves they are proxy of Iran and US won't like it as well. So Qatar only option left is Turkish & Pakistan.
Yesterday passing out parade of PAF include Qatari aviation & aeronautics engineering cadets.
Lastly there are exchange officers/armed personal program agreement b/w pakistan and middle eastern countries for last 40+ years