codes and phases (GPS)

In general, only the codes are used for SPP (Standard Point Positioning), which offers a precision of several metres. This is the precision of the majority of general public and low-cost GPS receivers: receivers in cars or smartphones.
On the other hand, more precise real-time positioning, such as RTK (Real-Time Kinematics), can only be done using phase measurements in order to achieve the famous real-time centrimetric precision required for topographical or civil engineering works. Obviously, in this case, the receiver is more sophisticated, and subsequently  more expensive.