Supposedly started in the military. this sounded logical:
There was a time when one would have simply said "Podunk" to mean "the middle of nowhere". Some time after Deliverance, and, not coincidentally, during a time when vulgarity began to be a more regular feature of comic acts, the exact geometric centre of nowhere became a fictional hamlet called Buttf**k (often Tennessee or Arkansas).
Lately, though, and especially in light of the Gulf Wars and 9/11, the Islamic world has become the target of choice for pejoratives. ********** was moved from the territory of the hill folk to somewhere a little less offensive to people living south of the Mason-Dixon line. The cultural origin of the original fictional town (the famous "squeal like a pig" scene) was lost, but the idea of backward sodomites in a foreign world survived the translation.
As for the abbreviation, well, that's something that tends to happen quickly in the world of SMS and tweets. If something occurs frequently and requires more than a couple of characters, somebody is going to abbreviate it. 4951