Links were the original ranking signal of Google and still count. A link from a relevant, trusted site, placed in an editorial context with a descriptive anchor, carries weight; hundreds of links from directories built for that purpose carry little and can trigger a penalty. Google's spam policies ask that paid or exchanged links be marked with rel=sponsored or rel=nofollow.
Earning links means producing something worth pointing at: a study, a tool, a comparison, a client case. Directories of experts such as SeoGeoMap link to listings for the reader's sake; that link counts as a mention and a reference, not as a lever to be bought.