the second function returns nothing
The string array in the second function:
char string[] = "Hello, World!";
has automatic storage duration. It does not exist after the control flow has returned from the function.
Whereas string in the first function:
char* string = "Hello, World!";
points to a literal string, which has static storage duration. That implies that, the string still exists after returning back from the function. What you are returning from the function is a pointer to this literal string.