That's because *s is simply the value that the pointer is pointing to.
if you have:
int a = 2;
int *b = &a;
printf("%d\n", *b);
a = 3;
printf("%d", *b);
it's gonna print:
2
3
but if you have:
int a = 2;
int b = 3;
int *c = &b;
printf("%d\n", a);
a = *c;
printf("%d\n", a);
*c = 5;
printf("%d\n", a);
it's gonna print
2
3
3
and not
2
3
5
because when you do a = *c;
it just copies the value of c into a, but establishes no further relation between c and a, which means you can change c or the value that it's pointing to whatever you want, and a is gonna continue holding that value that c had when you did that assignment. They're 2 different spaces in memory and what a = *c
does is merely copy the value that c is pointing to to a
What I mean by all that is that when you return *s
you're not returning the address to the memory s
is pointing to, but the value that it contains