As IFRs said, a pig is a solid plug to be run through a pipeline.
Some of them are the so called pipe inspection pigs.
Its function is to assess the pipe for obstructions, corrosion (i.e. wall thikness), coating quality, etc.
Modern sofisticated pigs have scratchers and sensors (typically...