Link spam
Link spam is links placed to manipulate search rankings, from comment and forum links to bought links. Google's policies forbid it.
Link spam is any link placed to push a site up the search results, with no thought for the reader. The classic kind is the irrelevant link dropped into a blog comment, a forum signature or a profile page. Google uses the name more widely in its spam policies, for every link made to manipulate rankings, including bought and swapped links.
You care about it from two sides: you don't want to build it, and you don't want it built for you.
What it looks like
Link spam is easy to spot once you've seen it. A comment that says "Great post!" with a link to a casino. A forum where every signature links to a payday loan site. A directory with thousands of entries and no visitors. Hidden links in the footer of a free website theme.
For example, Harrow & Pine might find 300 new links to its site in a week, all from comments on unrelated blogs, all saying "solid oak furniture." Nobody at Harrow & Pine placed them. They could come from an old agency, a bot, or a competitor.
What to do about it
If you built it, stop and clean up what you can. If someone else built it, Google says that in most cases it can work out on its own which links to trust. Its disavow tool exists for the rarer case where you have a lot of bad links and a manual action, or expect one.
Link spam and AI answers
Spam links sit on pages nobody reads, so they rarely reach an AI answer. The risk is indirect. If a manual action pushes your pages out of Google's results, they can't be shown in AI Overviews or AI Mode either, because those are built on Google Search. A page has to be in Google's index to appear as a link in its AI features, as Google explains in its guide to AI features.