probably from Old English *picg, found in compounds, ultimate origin unknown. Originally "young pig" (the word for adults was swine). Apparently related to Low German bigge, Dutch big ("but the phonology is difficult" -- OED). The meaning "oblong piece of metal" is first attested 1580s, on the notion of "large mass." Applied to persons, usually in contempt, since 1540s; the derogatory slang meaning "police officer" has been in underworld slang since at least 1811.
Another Old English word for "pig" was fearh, related to furh "furrow," from PIE *perk- "dig, furrow" (cf. Latin porc-us "pig," see pork). "This reflects a widespread IE tendency to name animals from typical attributes or activities" [Lass]. Synonyms grunter, porker are from sailors' and fishermen's euphemistic avoidance of uttering the word pig at sea, a superstition perhaps based on the fate of the Gadarene swine, who drowned. The image of a pig in a poke is attested from 1520s (see poke (n.3)). Flying pigs as a type of something unreal is from 1610s.