Dofollow links (the default) pass SEO authority from the source page to the destination page. They are the links that actually count for ranking. Nofollow links (with the rel="nofollow" attribute) tell Google that the source page does not endorse the link and should not pass authority.
In practice, nofollow links are used in: sponsored links (advertising), user-generated content (comments, forums), social media links and links you do not trust or do not want to endorse. Google also introduced rel="sponsored" (for paid links) and rel="ugc" (for user content) as more specific variants.
For link building, the focus should be on dofollow links from relevant websites. But nofollow links from high-authority sites (such as major news portals) also have value: they generate traffic, brand visibility and diversity in your backlink profile. A 100% dofollow profile is actually suspicious. Naturalness includes a healthy mix of both types.