For example, if the military must buy 50,000 of something it doesn't need from some military contractor located in some senator's district, that's a canonical example of pork.
The line here is subtle. The exact same purchase could be made through a competitive bidding process.
If I'm doing space research, that's probably good. If I mandate that NASA do a specific research project through a specific vendor, that's probably pork.
In most cases, pork isn't obvious. The bill won't say "NASA will give $50 million to Acme Inc," but rather "NASA will purchase $50 million worth of sheet metal from a veteran-owned company with at least 7 years experience in aluminum-matrix composite manufacturing, ..." and by the time you include all the requirements, what do you know, there's only one business which fits the bill.