Overview
pwd (print working directory) prints the full path of the current folder. With -L it prints the path as you reached it, including symbolic links; with -P it prints the physical path, with every link resolved. Without an option the builtin of most shells uses -L.
Background
The pwd command prints the working directory, and the Bash builtin keeps the logical path in the PWD variable. Today the name covers the Bash builtin, GNU pwd, the pwd that macOS ships, and the pwd applet in BusyBox. They agree on -L and -P.
Examples
Print the current folder and check that it is an absolute path:
pwd | grep -c '^/'
Move into a folder and print where you are:
cd logs && pwd | grep -c 'logs$'
After going through a symbolic link, -L keeps the link name:
ln -s logs lnk && cd lnk && pwd -L | grep -c 'lnk$'
-P shows the real folder behind the link:
ln -s logs lnk && cd lnk && pwd -P | grep -c 'logs$'
Options
-L
Print the logical path, keeping symbolic links as you used them.
-P
Print the physical path, with symbolic links resolved.
Common mistakes
The two options give different answers inside a linked folder, so a script that compares paths should choose one on purpose. On many systems /tmp or /var is itself a link, so pwd -P can print a longer path than you expect. pwd prints the folder of the shell that runs it; a script that changes folders in a subshell does not change yours.
Portability
Only -L and -P with the paths above are in the Common examples. The default when no option is given differs: the Bash builtin and the macOS executable use -L, while GNU /bin/pwd uses -P unless the POSIXLY_CORRECT variable is set. Give the option you mean. The Common examples were executed on Bash 5.2, GNU coreutils 9.11, macOS system tools, and BusyBox 1.37.0 (see the development guide for the exact check).
About macOS pwd
This is the pwd in the system folders of macOS. It follows the BSD implementation, and is the executable that runs when you call it by path, as in /bin/pwd. Without an option it prints the logical path, as -L does.
References
Original explanations, with upstream documentation for further reading. FreeBSD references are comparison material, not a claim of Apple version equivalence.