Pig
Middle English: probably from the first element of Old English picbrēd ‘acorn’, literally ‘pig bread’ (i.e. food for pigs).
wiktionary
From Middle English pigge(“pig, pigling”) (originally a term for a young pig, with adult pigs being swine), apparently from Old English *picga (attested only in compounds, such as picgbrēad(“mast, pig-fodder”)). Compare Middle Dutch pogge, puggen, pegsken(“pigling”).
A connection to early modern Dutch bigge (contemporary big(“piglet”)), West Frisian bigge(“pigling”), and similar terms in Middle Low German is sometimes proposed, "but the phonology is difficult". [1] Some sources say the words are "almost certainly not" related, [2] others consider a relation "probable, but not certain". [3]
The slang sense of "police officer" is attested since at least 1785. [4]
Origin unknown. See piggin.
etymonline
pig (n.1)
Middle English pigge "a young pig" (mid-13c., late 12c. as a surname), probably from Old English *picg, found in compounds, but, like dog, its further etymology unknown. The older general word for adults was swine, if female, sow, if male, boar. Apparently related to Low German bigge, Dutch big ("but the phonology is difficult" -- OED).
By early 14c. pig was used of a swine or hog regardless of age or sex. Applied to persons, usually in contempt, since 1540s; the derogatory meaning "police officer" has been in underworld slang at least since 1811.
The pigs frisked my panney, and nailed my screws; the officers searched my house, and seized my picklock keys. ["Dictionary of Buckish Slang, University Wit and Pickpocket Eloquence," London, 1811]
Another Old English word for the animal was fearh, which is related to furh "furrow," from PIE *perk- "dig, furrow" (source also of Latin porcus "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 late 14c. (see poke (n.1)). Flying pigs as a type of something unreal is from 1610s.
pig (v.)
mid-15c., piggen, of sows, "to farrow, to bring forth piglets," from pig (n.1). By 1670s as "to huddle together in a dirty or disorderly manner, as pigs do, hence, generally, "to act or live like a pig" in any sense. Related: Pigged; pigging. Colloquial pig out "eat voraciously" is attested by 1979.
pig (n.2)
"oblong piece of metal," 1580s, from pig (n.1) on the notion of "large mass." In Middle English sow also was used of a mass or bar of lead (mid-15c.).