I think the aid was provided to Pakistan as an reward for its
alliance in the war on terrorism. And Pakistan reciprocated by
providing shelter to and hiding OBL.
Lemme try to fix this up a bit for ya':
Pakistan was providing shelter to and hiding OBL, and aid was provided to Pakistan as payment for its "assistance" in the GWOT (more specifically, in A-stan).
The last time any western intelligence had any positive knowledge of OBL's whereabouts was Jalalabad august 20, 1998, when a bunch of cruise missiles where launched at suspected AQ camps (along with Khost and Khartoum, Sudan) following the US Embassy bombings in Africa.
Firing from positions in the Arabian Sea, the US had to notify Pakistan since the missiles had to cross Pakistani airspace to hit the targets in A-stan. There are differing reports on the amount of advance notice given, Pakistan claiming they knew hours in advance that that attacks were going to happen, while most US reports say they Pakistanis were given only about 10 minutes notice (Pakistan & India have fought 6 or so wars since 1947 partition, so the last thing anyone wanted was nuclear-armed Pakistan thinking that nulcear-armed India had launced some missiles). Anyhow, someone tips off OBL on the missile strikes, and he quickly leaves the Jalalabad location. US points the finger at a retired ISI chief, Hamid Gul. Hamid Gul is the same dude involved with the UTN and AQ Khan in trafficing nuclear technology to just about anybody. Pakistan has been supporting AQ for a loooong time. Hopefully the memory devices collected for the OBL compound a few days ago will help expose who, how much and how long. Not that any of that details will change whats already happened, nor will any of it likely have major changes in current relations.
As for getting Pakistan's assistance in the WOT and the fighting in A-stan......take a look at a map of the area. Check out A-stan's neighbours: a bunch of former SSR's, Iran, China, and pakistan. You've just attacked A-stan (quite likely for all the wrong reasons; there is ZERO evidence of the Afghan Taliban having any involvement or foreknowledge of 9/11, but based on the "we don't differentiate" Doctrine) and you need someone in the immediate area to provide a relatively secure staging area for transport. Again , look at the neighbours, and who are you going to choose? India would have been the best choice, but would still have to cross Pakistan. A "partner" was needed and Pakistan was the best of a lot of bad choices. Thats the way life goes sometimes.
Pakistan has always been duplicitious in its "alliance" with the west over terrorism. They are motivated primarily in serving their own interests first (as most nations are), but they just happen to be really really good at it (being duplicitious, that is). Its a tough neighbourhood to be in.