What if you have to link to a specific url in in twig, but you only have the nid? Moreover, it is good practice to use the id and not a hardcored url. Here's what you should use:
{{ path('entity.node.canonical', {'node': 522}) }}