In Docker Compose 2, links declared what other services were linked from a service. It was deprecated in favor of networks.
In Docker Compose 3, links declares alias hostnames by which other services can access a service.
I accidentally copied links from a StackOverflow snippet. @jimpo's comment here made me investigate and realize this was a mistake.