I found below function on this page Linked List | Set 2 (Inserting a node) - GeeksforGeeks I don't how its working

double pointer of structure being passed to this function

Code:
/* Given a reference (pointer to pointer) to the headof a list and an int, appends a new node at the end */
void append(struct Node** head_ref, int new_data)
{
    /* 1. allocate node */
    struct Node* new_node = (struct Node*) malloc(sizeof(struct Node));


    struct Node *last = *head_ref; /* used in step 5*/


    /* 2. put in the data */
    new_node->data = new_data;


    /* 3. This new node is going to be the last node, so make next
        of it as NULL*/
    new_node->next = NULL;


    /* 4. If the Linked List is empty, then make the new node as head */
    if (*head_ref == NULL)
    {
    *head_ref = new_node;
    return;
    }
    
    /* 5. Else traverse till the last node */
    while (last->next != NULL)
        last = last->next;


    /* 6. Change the next of last node */
    last->next = new_node;
    return;
}
I think function needs to be improved to compile code. The function doesn't return anything but here return keyword is written three times I don't understand what it returns when condition it true.