If you rename the current working directory while you're inside of it, the shell prompt won't change but programs like ls will still work. (below, $ represents the shell prompt).
/foo$ ls
foo-file
/foo$ readlink --canonicalize foo-file
/foo/foo-file
/foo$ mv /foo /bar
/foo$ ls
foo-file
/foo$ readlink --canonicalize foo-file
/bar/foo-file
The reason this happens even though it makes no sense at all is that the shell keeps track of the current directory's inode, which it can use to always get its actual filepath even after it has been renamed, but the default shell prompt and pwd just prints the $PWD environment variable, which isn't automatically updated when you do this.
To print the actual current working directory in this case, you need to use pwd -P. It's worth noting that pwd is a shell built-in that uses the $PWD variable, but /bin/pwd is a program that prints the actual current working directory.
/foo$ pwd -P
/bar
/foo$ /bin/pwd
/bar