Links aren't everything in SEO, but search professionals attribute a large portion of the engines' algorithms to link-based factors. Through links, engines can not only analyze the popularity of a website & page based on the number and popularity of pages linking to them, but also metrics like trust, spam, and authority. Trustworthy sites tend to link to other trusted sites, while spammy sites receive very few links from trusted sources.
The most common analogy of a link is to liken it to a vote. If page A links to page B then page A is suggesting page B is a good page, page A likes page B. The only slight complication is the nofollow tag. In a nutshell the nofollow tag allows links to be added to a page that create a click-able link to another page without the link passing a vote. These are used for text link adverts for example where they will send traffic to another page without passing a vote.