The Operating System uses two registers to implement memory protection, namely relocation register and limit register. Together, they can define the range of addresses a process can validly refer to.
When the dispatcher dispatches a process from ready to running state, the relocation register and the limit registers are given the respective values as per that process.
Each logical address generated by the CPU is checked against these registers to figure out if the logical address is out of bounds for the given process. This is how memory protection is implemented.