It's offensive because ''Paki'' is used as a derogatory term aimed at anyone from the Indian sub continent, the middle east, northern Africa, rather than specifically people from Pakistan.
It would be like someone from India calling all white people from Europe ''Taffies'' or ''Jocks'' or ''Paddies'', because we all look the same.... don't we?
Calling someone a Paddy may indeed be offensive, but not racist as the Irish are not a race, in the same way calling someone a Scouse twat is not racist.
If an Irish family moved in next door, you wouldn't know they were Irish until you spoke to them. But you know straight away if a ''Paki'' moves in next door because you can see the colour of their skin. But are they from Pakistan? Or India, Sri Lanka, Bangladesh, Egypt, Afghanistan, Nepal etc etc etc etc? That's the difference.